【发布时间】:2014-01-10 13:33:30
【问题描述】:
我正在创建一个带有可编辑字段的 jqgrid。我在 jqgrid 中有 2 个复选框列,一个来自 multiselect: true (以获取唯一的 rowId),另一个列是在列模型中创建的。
我想在我的列模型中处理复选框的 onchange(checked/unchecked) 事件,独立于其他复选框列 (multiselect:true)。任何帮助表示赞赏。下面是代码sn-p。
[{name : "userRole", label: 'OV', width: 40, editable:true, edittype:'checkbox',formatter: 'checkbox', editoptions: {value:"True:False"},
formatoptions: { disabled: false},frozen:true}]
multiselect: true,
onSelectRow: function(rowid){
jQuery(this).editRow(rowid, true);
}
【问题讨论】:
-
不要在你的 colmodel 中使用
formatter: 'checkbox',而是为复选框定义你自己的formatter函数。所以你可以包含你的onchange函数。
标签: javascript jquery checkbox jqgrid