PDA

View Full Version : Selection CheckboxModel doesn't fire events



Sadd
28 Aug 2012, 7:41 AM
I'm working with this following code:



function createGrid() {
sm = Ext.create('Ext.selection.CheckboxModel', {
checkOnly: true,
listener: {
select: function () { console.log("rowSelect"); }
, selectionchange: function () { console.log("rowSelect2"); }
}
});
if (gridPA!=null) {
gridPA.destroy(this);
}
rm = Ext.create('Ext.selection.CheckboxModel');
gridPA = Ext.create('Ext.grid.Panel', {
store: getStore(),
selModel: sm,
columns: gridColumns,
columnLines: true,
plugins: ['headertooltip'],
height: 600,
frame: true,
title: 'Choose Options',
iconCls: 'icon-grid',
renderTo: 'gridPA',
listeners: {
columnmove: function () {
numerateColumns();
}
}
});
return gridPA;
}


My first issue is the selection model doesn't fire any events when i select a row. The other issue is how can i get the rowIndex without use a Selection Model, in fact i'm using Ux Component Column and i want to know in which row are this elements when i change the value of combobox.

Thanks,
Regards
- Sadd

droessner
28 Aug 2012, 7:50 AM
As for the event not firing, you are missing an s. Should be listeners instead of listener.

Sadd
28 Aug 2012, 9:21 AM
My bad, thanks a lot.