SMART datagrid v.1 > Classes > EditOptions

Back  Forward

DataLudi.EditOptions.readOnlyCallback  property

当准备数据单元格编辑器时,返回编辑器的只读状态的回调函数。 

function (index:CellIndex):*;

如果明确返回Boolean true,就无法修改编辑器的值。 

默认值为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
可编辑和只读概述
editableOnlyCallback
readOnly
editable
DataColumn.readOnlyCallback
DataColumn.editableCallback
Examples
只读和可编辑
单元格编辑