Event Listeners

As with any w2ui widget, the panel follows common event flow. In example below you can see how to listen to all events dispatched to the layout.

var instant = false; $(function () { var pstyle = 'border: 1px solid #dfdfdf; padding: 5px;'; $('#layout').w2layout({ name: 'layout', panels: [ { type: 'top', size: 50, resizable: true, hidden: true, style: pstyle, content: 'top' }, { type: 'left', size: 200, resizable: true, hidden: true, style: pstyle, content: 'left' }, { type: 'main', style: pstyle, content: '
' }, { type: 'preview', size: '50%', resizable: true, hidden: true, style: pstyle, content: 'preview' }, { type: 'right', size: 200, resizable: true, hidden: true, style: pstyle, content: 'right' }, { type: 'bottom', size: 50, resizable: true, hidden: true, style: pstyle, content: 'bottom' } ] }); w2ui['layout'].on('*', function (event) { console.log('Event: '+ event.type + ' Target: '+ event.target); console.log(event); var log = $('#eventList').html(); $('#eventList').html( log + (log != '' ? '
' : '') + event.type + ': '+ event.target); }); });