stop .click() propagation to the grid
Hi all,
http://foxincloud.com/tutotest/wFormStandardPage.tuto?awForm=event.scx
for the demo, all events are implemented on all controls (events listed in the right textarea are processed by the server)
On the 'grid object' tab, clicking a cell also fires the same event at the grid level:
Grid MyGrid.Click()
Cell Fictxt1.Click()
Grid MyGrid.Mouseup(1, 0, 141, 77)
Cell Fictxt1.Mouseup(1, 0, 141, 77)
Grid MyGrid.Mousedown(1, 0, 141, 77)
Cell Fictxt1.Mousedown(1, 0, 141, 77)
How can we prevent this propagation?
eg. prevent that .onRowClicked() fires after .onCellClicked()
we tried in .onCellClicked(), without success:
return true;
return false;
http://foxincloud.com/tutotest/wFormStandardPage.tuto?awForm=event.scx
for the demo, all events are implemented on all controls (events listed in the right textarea are processed by the server)
On the 'grid object' tab, clicking a cell also fires the same event at the grid level:
Grid MyGrid.Click()
Cell Fictxt1.Click()
Grid MyGrid.Mouseup(1, 0, 141, 77)
Cell Fictxt1.Mouseup(1, 0, 141, 77)
Grid MyGrid.Mousedown(1, 0, 141, 77)
Cell Fictxt1.Mousedown(1, 0, 141, 77)
How can we prevent this propagation?
eg. prevent that .onRowClicked() fires after .onCellClicked()
we tried in .onCellClicked(), without success:
return true;
return false;
Thierry Nivelet (FoxInCloud)
November 27,
the page javascript: http://foxincloud.com/tutotest/event_scx_.js
Thierry Nivelet (FoxInCloud)
November 27,
It is not possible to prevent event propagation between cell/row/grid levels. As a workaround you can set a flag on event object while in cell handler and check the presence of this flag in row/grid handlers. You can use IE cancelBubble property -
obj.onCellClicked = function(event, col, row){
// cell handler
event.cancelBubble = true;
};
obj.onRowClicked = function(event, row){
if (!event.cancelBubble){
// row handler
}
};
Alex (ActiveWidgets)
November 30,
Works perfectly,
Thanks for the suggestion Alex!
Thanks for the suggestion Alex!
Thierry Nivelet (FoxInCloud)
December 1,
This topic is archived.
See also:
This example shows how to Drag and Drop Rows in a v2.0 Grid to change the row order
Rob Francis
(59)
Search Grid Column For Match
Joe
(45)
Grid in Grid - Inner grid lacks scroolbars
Diego Vilar
(13)
2.0 - I need a Grid inside a Grid
Rob Francis
(17)
Refresh Grid
joe
(27)
Grid Cell Not Displaying White Spaces
Jez (True Track Software)
(24)
Correct way to update table model in Extended Grid
Curt K.
(19)
Example - saving editable grid data to the server
Alex (ActiveWidgets)
(18)
How do you add an image to the first column in a grid?
L. Aragon
(17)
Back to support forum