3.2.0

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)
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!
Thierry Nivelet (FoxInCloud)
December 1,

This topic is archived.

See also:


Back to support forum