欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

js datagrid 怎么实现checkbox多选_html/css_WEB-ITnose

程序员文章站 2022-05-15 10:46:12
...
$('#test').datagrid({			title:'主表',				width:970,				height:325,				nowrap: false,				striped: true,				collapsible:true,				url:'datatest.php',				sortName: 'num',				remoteSort: false,                                  singleSelect: true,				//frozenColumns:[[{field:'ck',checkbox:true}]],                queryParams:{isaddhead:function(){return isaddhead}, hid:function(){return hid}},				columns:[[                                      {field:'num',title:'编号',width:30},					{field:'materialcode',title:'物料编码',width:120},					{field:'com',title:'单位',width:60},					{field:'quantity',title:'数量',width:40,rowspan:2},                                             {field:'name',title:'详细名称',width:350,rowspan:2},                                           {field:'date',title:'要求交货期',width:70,rowspan:2},                                           {field:'other',title:'其他要求',width:180,rowspan:2},					{field:'app',title:'状态',width:80,rowspan:1},				    {field:'state',title:'x',width:1,rowspan:1},				    {field:'rfqno',title:'x',width:1,rowspan:1}				]],				pagination:true,				rownumbers:true,				toolbar:[{					id:'btnadd',					text:'添加',					iconCls:'icon-add',					handler:function(){			                       if(isaddhead == 1 && !iscontrl && ismain==0 ) {                                                iscontrl = true;					     maindivreplace(1, null);                                            }					}				},{					id:'btndel',					text:'删除',					iconCls:'icon-remove',					handler:function(){	                   if(isaddhead == 1 && isselmain == 1 && !iscontrl && ismain==0) {	                                            $.post( "MainDataoper.php", {mainid:mainNum, requetype:"del",rfq_No:$('#prfqno').val(),formId:$('#formidold').val()},function(data) {                                                    isselmain =0;//重新加载前把状态改为主表没被选中                                                    isselqu = 0;//重新加载前把状态改为明细表没被选中                                                    $('#test').datagrid("reload");//datagrad重新加载                                                      $("#test2").datagrid('loadData',{total:0,rows:[]});                                                });                         }					}				},{					id:'btnedit',					text:'修改',					iconCls:'icon-edit',					handler:function(){     	                                     if(isaddhead == 1 && !iscontrl && isselmain ==1 && ismain==0) {                                                iscontrl = true;                                                isselmain = 0;                                                isselqu= 0;                                                var rowdata = $("#test").datagrid('getSelected');                                                maindivreplace(2, rowdata);//打开主表编辑div,                                            }											}				}],



请么实现多选
用frozenColumns:[[{field:'ck',checkbox:true}]] datagrid中有选项,但不能复选.

请问怎么实现?

回复讨论(解决方案)

singleSelect:false,
datagrid 属性

singleSelect:false,
datagrid 属性 +1

singleSelect : false,