Results 1 to 2 of 2

Thread: Something wrong with book of Learning ExtJS.4

  1. #1
    Sencha User
    Join Date
    Aug 2013
    Posts
    1

    Default Something wrong with book of Learning ExtJS.4

    Code:
    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...

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Try adding quote marks to your query

    Code:
    'toolbar[itemId = mainmenu] button[itemId = startbutton] menuitem'
    TBH .. I have never tried stacking queries like that ..

    Usually use :

    Code:
    'view-xtype button[itemId = startbutton] menuitem'
    Scott

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •