1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    93
    Vote Rating
    0
    vijayakumar84 is on a distinguished road

      0  

    Default Unanswered: change event not triggering in extjs4.1 using refs in controller

    Unanswered: change event not triggering in extjs4.1 using refs in controller


    change event not triggering in extjs4.1 using refs in controller.I have implemented following code .I have used combo box id cmbMarketRegion.can anybody correct me.If there is anything missing let me know

    Code:
    {
        xtype:'combo',
        id:'cmbMarketRegion',
        minWidth:50,
        minHeight:30,
        displayField:'marketRegionName',
        valueField:'marketRegionId'
    
    
        }
    Code:
    {
            ref: '#cmbMarketRegion',
       }
    
    
      ], 
    
    
       init: function() {
        this.control({
            'cmbMarketRegion': {
                change: 'valueChange'
            }
        });
    
    
        }, 
    
    
    
    
    valueChange:function(combo, ewVal, oldVal,optionsVal) {
        alert("hai");
    }

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,012
    Answers
    385
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    See if this works:

    Code:
    this.control({
        '#cmbMarketRegion': {
            change: 'valueChange'
        }
    });

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    67
    Answers
    5
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default


    From memory I think,

    proper definition of a ref is as such:
    Code:
    refs: [
            {
                ref: 'UpdateGrid',
                selector: '#updatePicklistGrid'
            }
        ],
    I am using Sencha architect to create a ref to one of my grid on the view. The definition of your ref is slightly different. Its missing a selector. Sencha Architect creates a ref in this way by default.


    Hope it helps

    Thanks

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Posts
    93
    Vote Rating
    0
    vijayakumar84 is on a distinguished road

      0  

    Default


    thanks slemmon ,mazhar.shaikh for reply can anybody tell what is selector how to use it

  5. #5
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,012
    Answers
    385
    Vote Rating
    183
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    The syntax for refs can be found here:
    http://docs.sencha.com/extjs/4.2.0/#...oller-cfg-refs

    The API doc shows how to set up both the ref and the selector portion of the refs config.