it's similar question posted issue http://www.sencha.com/forum/showthread.php?245591
here code grid (please note commented listener declared in grid works fine)
ext.define( 'fast.view.sales.salesforecastdealersgrid ' ,{ extend: 'ext.grid.panel', alias : 'widget.salesforecastdealersgrid' , selmodel: ext.create( 'ext.selection.checkboxmodel' ),// sm, requires:[ 'ext.toolbar.paging'], columnlines: true, store: 'sales.salesforecastdealers', //'sales.productbyaccount', columns: [{text: 'dealer id',hidden: true ,flex:1,dataindex:'dealerid' }, {text: 'customer name',flex:1,sortable: true,dataindex: 'dealername' }, {text: 'sales ids',hidden: true,flex:1,sortable: false ,dataindex:'salesids' }], initcomponent: function () { .dockeditems = [ { xtype: 'pagingtoolbar' , dock:'bottom' , store: 'sales.salesmonthfct' ,//localstore, displayinfo: true , displaymsg: 'displaying productbyaccount {0} - {1} of {2}' +'     ', emptymsg: "no productbyaccount display" }]; .callparent(arguments); } /*, listeners:{ selectionchange : function(model, records) { // var records = grid.getselectionmodel().getselection(); alert('section changed handler'); }}*/ });
and controller
ext.define( 'fast.controller.sales.salesforecastcontroller', { extend: 'ext.app.controller', stores: ['sales.salesweekfct' ,'sales.salesmonthfct' ,'sales.salesforecastdealers' ], models: [ 'sales.salesweekfctmodel', 'sales.salesmonthfctmodel' ], views: ['sales.salesforecastweeklygrid' ,'sales.salesforecastmonthlygrid' ,'sales. salesforecastdealersgrid' ], refs: [{ref: 'salesforecastweeklygrid',selector: 'salesforecastweeklygrid' } ,{ref: 'salesforecastmonthlygrid' ,selector: 'salesforecastmonthlygrid' } ,{ref: 'salesforecastdealersgrid ',selector: 'salesforecastdealersgrid '} ], init: function () { .control({ //'salesforecastdealersgrid [action=change]': {selectionchange: this.dealerselectionchange}, 'salesforecastdealersgrid ': {selectionchange: .dealerselectionchange} }); }, dealerselectionchanged : function (model, records) { //var records = grid.getselectionmodel().getselection(); alert( 'controllers section changed handler' ); } });
as notice i've commented line "'salesforecastdealersgrid [action=change]': {selectionchange : this.dealerselectionchange}," because can't find documentation '[action=change]' , not fire in case.
with code when click on grid row i'm getting error message in console
typeerror: listener.firefn undefined ...listener && listener.firefn.apply(listener.scope || me.observable, args) === fal...
any idea can try next?
thank in advance.
your controller not have function:
selectionchange: .dealerselectionchange
because function name is:
dealerselectionchanged : function (model, records)
Comments
Post a Comment