0
我有我想切換單元格爲只讀/可編輯的情況,具體取決於某些條件。它幾乎可以工作,我可以只讀,但不能再編輯。在jqGrid中切換單元格只讀/可編輯
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', '', '');
}
}]
}
});
任何想法?
小打字錯誤:'ICOL [ICOL] .name'應是'colModel [iCol] .name'。 – Oleg 2012-04-11 08:30:09
修好了,謝謝。 – tpeczek 2012-04-11 09:04:49
不客氣! – Oleg 2012-04-11 19:51:43