我現在用的是MVC頁面,上邊有一個文本框輸入相應的內容,下邊有個datagrid去數據庫查詢相應的內容并顯示,但是每條記錄前邊都要放上一個checkbox,插入一段我寫的js,現在的問題是,頁面上的checkbox一點擊就報錯:?'on' 為空或不是對象,?'off' 為空或不是對象
$('#subDataGrid').datagrid({
columns: [[
{ field: 'IsCheck', title: '是否選擇', width: 100, editor: 'checkbox', formatter: boolFormat, align: 'center' },
{ field: 'Name_Product', title: '商品名稱', width: 100 }
]],
idField: 'ID',
onClickRow: function (rowIndex) {
if (lastIndex != rowIndex) {
$('#subDataGrid').datagrid('endEdit', lastIndex);
$('#subDataGrid').datagrid('beginEdit', rowIndex);
}
lastIndex = rowIndex;
}
});
添加回答
舉報
0/150
提交
取消