PDA

View Full Version : [CLOSED][DUP][4.0.0] beforeselect Event in Grid is never fired



harrydeluxe
29 Apr 2011, 9:47 AM
Here is my work around:


Ext.override(Ext.selection.RowModel,
{
// Allow the GridView to update the UI by
// adding/removing a CSS class from the row.
onSelectChange: function(record, isSelected, suppressEvent) {

var me = this,
views = me.views,
viewsLn = views.length,
store = me.store,
rowIdx = store.indexOf(record),
i = 0,
allowSelect = true;

for (; i < viewsLn; i++) {
if (isSelected) {

allowSelect = me.fireEvent('beforeselect', me, record, rowIdx) !== false;

if (allowSelect) {
views[i].onRowSelect(rowIdx, suppressEvent);
if (!suppressEvent) {
me.fireEvent('select', me, record, rowIdx);
}
}

} else {
views[i].onRowDeselect(rowIdx, suppressEvent);
if (!suppressEvent) {
me.fireEvent('deselect', me, record, rowIdx);
}
}
}
}
});

evant
1 May 2011, 11:55 PM
http://www.sencha.com/forum/showthread.php?131917-beforeselect-event-on-grid-panel-does-not-fire.

Please follow this here.