SMART datagrid v.1 > Examples

[ grids ver.1.3.2]   Back  Forward

ReadOnly & Editable  Example

1. Read Only

If specify readOnly of the cell to be edited as true, the user will not be able to modify the cell value in any way during the run time. The order below, in which have applied various settings, can determine whether the editing cell is readOnly. 

Table-1  readOny decision order
PropertiesDefault ValueExplanation
falseIf it is true, you will not be able to edit or modify in all cells regardless of the other settings. In other words, it will become readOnly in all cells.
falseIf it is specified as true, all cells will become readOnly regardless of the other settings. Also, the row updating, inserting or deleting will become impossible.
trueIf the data field connected to the editing cell is an unamendable field or updatable is false, it will become readOnly.
nullIf explicitly return Boolean false or true in this callback function, readOnly will be decided by this value and the rest decision process will be cancelled. If do not return the value, it will run the next decision stage.
nullIt will run in the same way as the above column callback.
Grid - 1
0 rows

If readOnly has not been decided in the stage above, and if even one of below settings corresponding to the editing cell has been specified as true, the editing cell will become readOnly. editable related settings have been specified as true

Table-2  readOnly related properties
PropertiesDefault ValueExplanation
falseIf specified as true, all cells contained in this column will become readOnly.
falseIf specified as true, the cells contained in Fixed Columns will become readOnly.
falseIf specified as true, the cells contained in Fixed Rows will become readOnly.
trueIf specified as true, the cells contained in the rows of Deleted State will become readOnly.

  

2. Editable

If specify editable of the cell to be edited as false, the editor will not be displayed in the cell. And in the case of the editable renderer, the cell value will not be changed by the keyboard or mouse. 

Table-3  editable decision order
PropertiesDefault ValueExplanation
falseIf it is true, it will not be able to edit or modify in all cells regardless of the other settings. In other words, it will become not editable in all cells.
trueIf it is specified as false, all cells will become not editable regardless of the other settings.
nullIf explicitly return Boolean false or true in this fallback function, editable will be decided by this value and the rest decision process will be cancelled. If do not return the value, it will run the next decision stage..
nullIt will run in the same way as the above column callback.
Grid - 2
0 rows

If readOnly has not been decided in the stage above, and if all below settings corresponding to the editing cell have been specified as true, the editing cell will become editable. readOnly related settings have been specified as false

Table-4  editable conditions
PropertiesDefault ValueExplanation
trueIf specified as false, the cells contained in this column will become not editable.
trueIf specified as false, the cells contained in Fixed Columns will become not editable.
trueIf specified as false, the cells contained in Fixed Rows will become not editable.
falseIf specified as true, the cells contained in the rows of Deleted State will become editable.
If explicitly return Boolean false in the onShowEditor event handler, the editor will not be displayed.

  

View Source JSP 

See Also
GridBase.readMode
EditOptions.readOnly
EditOptions.editable
EditOptions.readOnlyCallback
EditOptions.editableCallback
EditOptions.deletedRowReadOnly
EditOptions.fixedRowReadOnly
EditOptions.fixedColumnReadOnly
EditOptions.deletedRowEditable
EditOptions.fixedRowEditable
EditOptions.fixedColumnEditable
DataColumn.readOnly
DataColumn.editable
DataColumn.readOnlyCallback
DataColumn.editableCallback
Examples
Cell Editing