PDA

View Full Version : [OPEN] [OPEN-EXTJSIV-1812]beforeselect event on grid panel does not fire.



JPfahl
29 Apr 2011, 1:18 PM
The beforeselect event on the grid panel does not fire.

harrydeluxe
24 May 2011, 4:55 AM
bring forward.

tvanzoelen
25 May 2011, 4:58 AM
Is there a workaround for this? A missing beforeselect event is blocking my migration to ExtJs 4.

Terence

harrydeluxe
26 May 2011, 3:31 AM
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);
}
}
}
}
});

This workaround prevented only a visual select.

tvanzoelen
26 May 2011, 4:44 AM
I need a full working beforeselect. I also wonder why this event in no longer part of the RowSelectionModel. It's in the grid view.

beforeselect, select and after select must be implemented somehow. A row select changes the information state in an application. I use beforeselect for validation if any record on the screen is in edit mode. Then you get a pop up etcera....

I am really amazed that this isn't a blocking issue for other programmers. This migration to ExtJs 4 is getting me on my nerves....

harrydeluxe
26 May 2011, 6:41 AM
I feel the same.

edspencer
5 Jun 2011, 1:13 PM
This is on top of the priority list for 4.0.2

dongryphon
5 Jun 2011, 10:05 PM
The fix has been merged in to 4.0.2. There is also a beforedeselect event that can be used to prevent the selection from leaving a row. These events apply to grid and dataview as well.

winkelmann
5 Oct 2012, 4:49 AM
It appears this is still not fixed in 4.1.2 ...