1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    9
    Vote Rating
    0
    kishore_r is on a distinguished road

      0  

    Default Combobox.select() not firing event

    Combobox.select() not firing event


    I have the following code in my contoller
    Code:
    Ext.define('MyApp.controller.Installation', {
        extend: 'Ext.app.Controller',
    
    
      refs: [{
            ref: 'installationsCombo',
            selector: 'breadcrumb combobox'
        }],
            
        stores: ['Installations'],
        
        models : ['AppState'],
    
    
        init: function() {
            // Start listening for events on views
            this.control({
                'breadcrumb combobox': {
                    select: this.onInstallationSelect,
                    scope: this
                }
            });
        },
    
    
        onLaunch: function() {
            var installationsStore = this.getInstallationsStore();
            installationsStore.load({
                callback: this.onInstallationsLoad,
                scope: this
            });
        },
    
    
        onInstallationsLoad: function() {
            var installationsCombo = this.getInstallationsCombo();
            installationsCombo.select(1);
        //installationsCombo.fireEvent("select", this.getInstallationsStore().getAt(0));;
        },
    
    
        onInstallationSelect: function(selModel, selection) {
            console.log("Installation selection changed");
    
            this.getAppStateModel().selectedInstallationId = selection[0].get('installationId');
            this.getAppStateModel().selectedInstallationName = selection[0].get('name');
            
           // Fire an application wide event
            this.application.fireEvent('installationSelect', selection[0]);
            console.log("Installation Select Event fired");        
        },

    The problem I am facing is that the " installationsCombo.select(1); " is not firing the select event and hence the onInstallationSelect method is not being called. I use this event to load other parts of the application. When I make a selection from the combobox manually, everything works.

    Any ideas as to why the select() method on the combo box is not firing the select event?

    Thanks in advance.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,581
    Vote Rating
    433
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Does change fire for both selection and using setValue?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.