1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    235
    Vote Rating
    0
    chandan.behura is on a distinguished road

      0  

    Default event in controller

    event in controller


    Hi,
    I am unable to get the selectionchange event of grid in controller.
    Give all my codes.
    grid code that is inside a window.
    Code:
    var regionSM = Ext.create('Ext.selection.CheckboxModel');
    Ext.define('LLSO.view.deliveryGroupPerformance.summary.SummaryRegionPopUp', {
        extend : 'LLSO.view.components.PopUp',
        alias : 'widget.summaryregionpopup',
        id : 'summaryregionpopup',
        title : 'summaryregionpopup',
        requires : [ 'LLSO.view.components.CheckGrid' ],
        action : 'showRegion',
        initComponent : function() {
            this.items = [
            {
                xtype : 'checkgrid',
                itemId : 'regionCheckgridId',
                id : 'regionCheckgridId',
                store : 'deliveryGroupPerformances.RegionStore',
                selModel : regionSM,
                selType : 'checkboxmodel',
                action : 'change',
                columns : [ {
                    menuDisabled : true,
                    dataIndex : 'region',
                    text : 'All',
                    flex : 1
                } ],
                viewConfig : {
                    stripeRows : true,
                    action : 'regionPrefAction'
                    
                }/*,
                listeners :{
                    selectionchange : function(){
                        alert(6);
                    }
                }*/
            } ];
            this.callParent(arguments);
        },
        layout : {
            type : 'vbox',
            align : 'right'
        }
    
    });
    controller
    Code:
                'checkgrid[action=change]': {
                    selectionchange : this.onSelectionChange
                    }
    
    
    
        onSelectionChange: function(){
            alert("got change");
        },
    But when i am using the listener inside the view it is working.

    How i will take the selectionchange event to controller

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,010
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    First issue I see is you are creating an instance of the checkbox selection model outside initComponent. You should move that line to within the initComponent.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

Thread Participants: 1

Tags for this Thread