5 'Ext.window.MessageBox'
8 Ext.onReady(function(){
9 var action = Ext.create('Ext.Action', {
13 Ext.example.msg('Click', 'You clicked on "Action 1".');
17 var panel = Ext.create('Ext.panel.Panel', {
19 renderTo: document.body,
27 action, // Add the action directly to a toolbar
30 menu: [action] // Add the action directly to a menu
34 items: Ext.create('Ext.button.Button', action) // Add the action as a button
38 * Add toolbar items dynamically after creation
40 var toolbar = panel.child('#toolbar');
44 action.setDisabled(!action.isDisabled());
45 this.setText(action.isDisabled() ? 'Enable' : 'Disable');
50 Ext.Msg.prompt('Enter Text', 'Enter new text for Action 1:', function(btn, text){
51 if(btn == 'ok' && text){
53 action.setHandler(function(){
54 Ext.example.msg('Click','You clicked on "'+text+'".');
62 action.setIconCls(action.getIconCls() == 'icon-add' ? 'icon-edit' : 'icon-add');