AllowChangeSelectedRow - cWebGrid
Returns True if a row change is allowed. Current row may be saved or restored to its unchanged state
Type: Function
Return Data Type: Boolean
Parameters
| Parameter | Type | Description |
|---|---|---|
| sGotoRow | String | |
| sToRowID | String |
Syntax
Function AllowChangeSelectedRow String sGotoRow String sToRowID Returns Boolean
Call Example
Get AllowChangeSelectedRow sGotoRow sToRowID to BooleanVariable
Description
AllowChangeSelectedRow returns True if you can move off of the selected row. This gets called during a row change and returns True if the row change is allowed. You are allowed to make changes to the row such as saving or clearing before returning if the row change is allowed.
The following actions are performed:
ShouldSaveRow is tested. This will test if the current row needs saving or clearing. If False, a row change is allowed.
If the row has changes, it will attempt to either save or clear the row based on the value of pbAutoSave. If pbAutoSave is True, it will attempt a save by calling SaveSelectedRow. Else, it will attempt a clear by calling ClearSelectedRow.
If the Save or Clear was a success, a row change is allowed.
If it was not a success, the row change is not allowed.
A special third case exists. If the row needs to generate a save or data-loss verification message, it will not allow the row change. This would require an extra client/server round trip, which cannot be done in the middle of a row change. In such a case, the user must explicitly save or clear the row before attempting the row change.