SMART datagrid v.1 > Classes > EditOptions

Back  Forward

DataLudi.EditOptions.readOnlyCallback  property

Callback function which returns the read-only state of editor when prepare the data cell editor. 

function (index:CellIndex):*;

If explicitly return Boolean true, you will not be able to update the value of editor. 

Defaults to null.

Getter
function readOnlyCallback(): Function
Setter
function setReadOnlyCallback(value: Function)
Note
Code -1
    grid.editOptions().setReadOnlyCallback(function (index) {
        if (index.grid().getValueAt(index.rowIndex, 'qty') > 10000) {
            return true;
        }
    });
Code -2
    grid.setEditOptions() {
        readOnlyCallback: function (index) {
            if (index.grid().getValueAt(index.rowIndex, 'qty') > 10000) {
                return false;
            }
        }
    };
See Also
Editable & ReadOnly Overview
editableOnlyCallback
readOnly
editable
DataColumn.readOnlyCallback
DataColumn.editableCallback
Examples
ReadOnly & Editable
Cell Editing