SMART datagrid v.1 > Classes > DataColumn

Back  Forward

DataLudi.DataColumn.readOnlyCallback  property

Callback function which returns read-only state of editor when preparing 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
    column.setReadOnlyCallback(function (index) {
        if (grid.getValueAt(index.rowIndex, 'qty') > 10000) {
            return true;
        }
    });
Code -2
    var columns = [{
        name: 'colRate',
        readOnlyCallback: function (index) {
            if (grid.getValueAt(index.rowIndex, 'qty') > 10000) {
                return false;
            }
        }
    },
    ...
    ];
    grid.setColumns(columns);
See Also
Editable & ReadOnly Overview
readOnly
editable
EditOptions.readOnlyCallback
EditOptions.editableCallback
Examples
ReadOnly & Editable
Cell Editing