3.2.0

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
July 17,
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)
July 18,
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
July 18,
I think you need both.
Alex (ActiveWidgets)
July 21,

This topic is archived.

See also:


Back to support forum