我有我想根据某些条件将单元格切换为只读/可编辑的情况。它几乎可以工作,我可以将其设为只读,但不能再次编辑。
grid.setColProp("a", {
editoptions: {
value: data.opPadrag,
dataEvents: [{
type: 'change',
fn: function (e) {
var selr = grid.jqGrid('getGridParam', 'selrow');
if (someCondition) grid.jqGrid('setCell', selr, 'c', '', 'not-editable-cell');
else
// Problem here - how to make it editable. I've tried a few ways, none worked
// grid.jqGrid('setCell', selr, 'c', '', 'editable-cell');
// grid.jqGrid('setCell', selr, 'c', '', 'editable');
// grid.jqGrid('setCell', selr, 'c', '', '');
}
}]
}
});
有任何想法吗?