Enable/Disable Buttons

It is easy to enable and disable buttons during the run time. The example below demonstrates how to do this.
$(function () { $('#toolbar').w2toolbar({ name: 'toolbar', items: [ { type: 'button', id: 'disable', caption: 'Disable', img: 'icon-delete' }, { type: 'button', id: 'enable', caption: 'Enable', img: 'icon-add' }, { type: 'break', id: 'break0' }, { type: 'button', id: 'btn', caption: 'Action Button', img: 'icon-page' }, { type: 'button', id: 'btn2', caption: 'Other Button', img: 'icon-page' } ], onClick: function (event) { if (event.target == 'enable') this.enable('btn'); if (event.target == 'disable') this.disable('btn'); } }); });