PDA

View Full Version : Something wrong with book of Learning ExtJS.4



Afra
16 Aug 2013, 5:37 PM
Ext.define('MyApp.controller.main.Main',{
extend : 'Ext.app.Controller',
init : function(){
var me = this;
//Step 1
me.control({
toolbar[itemId=mainmenu] button[itemId=startbutton] menuitem: {
click : me.openModule
}
});
},
//Step 2
openModule : function(menuoption){
console.log('Open the module now!');
}
});

The code comes from Learning ExtJS4 of Cryfel.Villa
Is there anything wrong with Step 1? I can't run it in Eclipse~
Please...

scottmartin
16 Aug 2013, 7:49 PM
Try adding quote marks to your query



'toolbar[itemId = mainmenu] button[itemId = startbutton] menuitem'


TBH .. I have never tried stacking queries like that ..

Usually use :



'view-xtype button[itemId = startbutton] menuitem'


Scott