:: Forum >>
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;
Thierry Nivelet (FoxInCloud)
Thursday, November 27, 2014
Thierry Nivelet (FoxInCloud)
Thursday, November 27, 2014
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){
event.cancelBubble = true;
};
obj.onRowClicked = function(event, row){
if (!event.cancelBubble){
}
};
Alex (ActiveWidgets)
Sunday, November 30, 2014
Works perfectly,
Thanks for the suggestion Alex!
Thierry Nivelet (FoxInCloud)
Monday, December 1, 2014
This topic is archived.
Back to support forum
Forum search