首页 新闻 赞助 找找看

EasyUI的datagrid里checkbox问题

0
[已解决问题] 解决于 2013-01-09 09:30

我现在用的是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;
                    }
                });
淘@淘的主页 淘@淘 | 小虾三级 | 园豆:602
提问于:2013-01-08 09:33
< >
分享
最佳答案
1
奖励园豆:5
snjsunyan | 初学一级 |园豆:55 | 2013-01-08 10:39

这个文档我也有一份,现在我又改成这样了,但又有问题了,只能单选,不能多选

{field: 'IsCheck', title: '是否选择', width: 100, formatter: boolFormat, checkbox: true, align: 'center',
editor: {
    type: 'checkbox',
    options: {
        on: 1,
        off: 0
    }
}
},
淘@淘 | 园豆:602 (小虾三级) | 2013-01-08 10:45
其他回答(1)
0
singleSelect:false
淘@淘 | 园豆:602 (小虾三级) | 2013-01-09 09:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册