条件に応じて、セルを読み取り専用/編集可能に切り替えたい場合があります。ほぼ機能します。読み取り専用にすることはできますが、再度編集することはできません。
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', '', '');
}
}]
}
});
何か案は?