PDA

View Full Version : Get grid component that fires a selectionmodel select event



filippo.ferrari
21 Mar 2014, 3:10 AM
Hallo,


I've to do something on row select on a grid panel.
select event parameters are:


- this (the selection model not the grid),
- record,
- index,
- eOpts


How to refer to the grid?

jad_Topnetwork
21 Mar 2014, 4:57 AM
Hy try eOpts.scope

filippo.ferrari
21 Mar 2014, 5:38 AM
eopts is present in documentation but:TypeError: eOpts is undefinedconsole.log(eOpts.scope);in Firebug Why???

jad_Topnetwork
21 Mar 2014, 6:00 AM
try like this

{
xtype: 'gridpanel',
...
listeners: {
select: function (model (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.selection.RowModel), record, i) {
grid = this;
}
}

}

filippo.ferrari
21 Mar 2014, 6:54 AM
... and then?

jad_Topnetwork
21 Mar 2014, 6:56 AM
...

grid = this;

...

filippo.ferrari
24 Mar 2014, 1:26 AM
I'm using a MVC architecture... this is not the grid but the controller....

jad_Topnetwork
24 Mar 2014, 1:34 AM
You cane make refs in your controller

Ext.define('MyApp.controller.MyController', {
extend: 'Ext.app.Controller',


refs: [
{
ref: 'MyRef',
selector: 'grid[id=My_id]'
},

and then

grid = this.getMyRef()