3.2.0

Cancel row clicks and changes (v2.5.1)

I'm shifting from v1 to v2.5.1, and am trying to cancel row clicks and changes (in both single and multi select modes). I've tried all the suggestions I could find in the Support Forum and documentation (e.g. return 1 from onSelectedRowsChanging and onCurrentRowChanging), but can't seem to stop changes. I must be missing something. Has anybody had the same problem and been able to solve it? Any example code would be much appreciated. Thanks.
Justin
February 27,
To prevent row selection you can either cancel onRowSelectedChanging event (or better all three to be sure) -

obj.onRowSelectedChanging = function(){return 1};
obj.onSelectedRowsChanging = function(){return 1};
obj.onCurrentRowChanging = function(){return 1};

or you can cancel mouse click, in this case onRowClicking event (this one fires immediately after mouseDown and focus events but before mouseUp and click) -

obj.onRowClicking = function(){return 1};
Alex (ActiveWidgets)
February 29,
And also if you want to completely disable row/cell selection -

obj.setSelectionMode("none");
Alex (ActiveWidgets)
February 29,
Alex, thanks for the tips. I'll try them out. By the way, I'm trying to cancel clicks only in certain situations, rather than prevent clicks altogether (e.g. user tries to change a row selection whilst there are unsaved changes on the page relating to the currently selected row, and I want to ask the user if they want the changes saved etc). Thanks.
Justin
March 2,
Alex, thanks again for the tips. They helped me do what I was after. Much appreciated.
Justin
March 3,

This topic is archived.

See also:


Back to support forum