SMART datagrid v.1 > Concepts

[ grids ver.1.3.3]   Back  Forward

Concepts.Editable and ReadOnly  Preparing...

The user can directly update values during the run time by using cell editor or editable cell renderer, pasting clipboard, clearing selected area, etc. In particular, you can only display cell editor to check the hidden part rather than to update the value. At this point, because of grid UI characteristic, you may need to manage the availability of user update and editor display in each data column, data row or data cell level in detail, and in order to manage the availability of editor display in a specific data cell through editable and the availability of user update of cell value through readOnly, SMART datagrid provides the property, callback function and event in many locations. 

1. editable

Check editable state of the corresponding cell before displaying the editor in the cell. If check the paths below in the order and become false, the editor will not be displayed. 

Table-1  readOnly related properties
PropertyDefault valueExplanation
GridBase.readModefalseIf it is true, you will not be able to edit or update in all cells regardless of other settings. In other words, it will become not editable in all cells.
EditOptions.editabletrueIf specify as false, all cells will become not editable regardless of other settings.
DataColumn.editableCallbacknullIf explicitly return Boolean false or true within this callback function, editable will be determined by that value and the rest decision procedure will be cancelled. If do not return the value, it will run the next decision stage.
EditOptions.editableCallbacknullIt will be run in the same way of column callback as above.
DataColumn.editabletrueIf specify as false, cells being included in this column will become not editable.
EditOptions.fixedColumnEditabletrueIf specify as false, cells being included in Fixed Columns will become not editable.
EditOptions.fixedRowEditabletrueIf specify as false, cells being included in Fixed Rows will become not editable.
EditOptions.deletedRowEditablefalseIf specify as true, cells being included in Deleted rows will become editable.
2. readOnly

Check readOnly state before updating the value in the cell to be edited by using editor and renderer, pasting, clearing the selected area, etc. If check the paths below in the order and become true, the value will not be updated. 

Table-2  readOny decision order
PropertyDefault valueExplanation
GridBase.readModefalseIf it is true, you will not be able to edit or update in all cells regardless of other settings. In other words, it will become readOnly in all cells.
EditOptions.readOnlyfalseIf specify as true, all cells will become readOnly regardless of other settings. And, you will not be able to do row updating, appending, deleting.
DataField.updatablefalseIf data field being connected to edit cell is not updatable or updatable is false, it will become readOnly.
DataColumn.readOnlyCallbacknullIf explicitly return Boolean false or true within this callback function, readOnly will be determined by that value and the rest decision procedure will be cancelled. If do not return the value, it will run the next decision stage.
EditOptions.readOnlyCallbacknullIt will be run in the same way of column callback as above.
DataColumn.readOnlyfalseIf specify as true, cells being included in this column will become readOnly.
EditOptions.fixedColumnReadOnlyfalseIf specify as true, cells being included in Fixed Columns will become readOnly.
EditOptions.fixedRowReadOnlyfalseIf specify as true, cells being included in Fixed Rows will become readOnly.
EditOptions.deletedRowReadOnlytrueIf specify as true, cells being included in Deleted rows will become readOnly.
See Also
Cell Editing Overview
Examples
ReadOnly & Editable