:: Forum >>

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
Wednesday, February 27, 2008
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)
Friday, February 29, 2008
And also if you want to completely disable row/cell selection -

obj.setSelectionMode("none");
Alex (ActiveWidgets)
Friday, February 29, 2008
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
Sunday, March 2, 2008
Alex, thanks again for the tips. They helped me do what I was after. Much appreciated.
Justin
Monday, March 3, 2008

This topic is archived.


Back to support forum

Forum search