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