:: Forum >>

Disable/enable grid

Is it possible to disable grid row selection except for the row being edited.

The flow of my application screen is:
1- when a row is clicked on the grid, I show up a new edit screen with the option to save the changes to the row being edited
2- during this edit process, I would like to disable row selection for all other rows.
3- After the save on the edit row, I would like to enable all rows for further edit

Currently, I am handling this by maintaining the row number being edited (editRowNum):
grid.onRowClicked = function(event, index) {
if (editRowNum != null) {
awContactsGrid.setCurrentRow(editRowNum);
awContactsGrid.setSelectedRows([editRowNum]);
return;
}
}

This works good. But wanted to know if this is the proper way of handling this situation.

Please advice...

Sorry - I missed putting a subject on my previous post for the same issue. So, I am reposting just to be clear...
JJ
Thursday, July 17, 2008
it is possible to 'freeze' selection if you cancel (return nonzero code) onCurrentRowChanging and onSelectedRowsChanging events -

grid.onCurrentRowChanging = function(i){
if(...){
return 1; // cancel event
}
}

grid.onSelectedRowsChanging = function(array){
if(...){
return 1; // cancel event
}
}
Alex (ActiveWidgets)
Friday, July 18, 2008
Thanks Alex !

Do I need to implement both grid.onCurrentRowChanging and grid.onSelectedRowsChanging functions to freeze row selection when one of the rows is being edited ? or just implementing the grid.onCurrentRowChanging should do ?
JJ
Friday, July 18, 2008
I think you need both.
Alex (ActiveWidgets)
Monday, July 21, 2008

This topic is archived.


Back to support forum

Forum search