2 qq 25859521 qq_25859521 于 2016.02.23 15:30 提问

easyui 分页查询 点击下一页的时候怎么把上一页多选框勾选的多选框清空
        var columns = [[
                { field:'ck',checkbox:true },
                {field:'productcode',title:'商品代码',width:70,align:'left',sortable:true},
                {field:'productdesc',title:'商品名称',width:70,align:'left',sortable:true},
                {field:'barcode',title:'条形码',width:70,align:'left',sortable:true},
                {field:'isWeight',title:'称重商品',width:70,align:'left',sortable:true,formatter:function(value){
                    if(value==1){
                        return "是";
                    }
                    (value==0)
                    {
                        return "否";
                    }
                }},
                {field:'retailprice',title:'零售价',width:50,align:'left',sortable:true},
                {field:'tradeprice',title:'进货价',width:50,align:'left',sortable:true,hidden:true},
                {field:'miniUnit',title:'最小单位',width:70,align:'left',sortable:true},    
                {field:'remarka',title:'拼音首字母',width:70,align:'left',sortable:true},
                {field:'remarkb',title:'特殊类型',width:70,align:'left',sortable:true},  

                {field:'supplierid',title:'供应商',width:70,align:'left',sortable:true},

                {field:'picUrl',title:'图片地址',width:70,align:'left' , formatter: function (value, rec) {
                    if(value==null||value==""){
                        return "无图片";
                    }else{}
                 return "<img width=30px heigth=30  src=<%=basePath %>allfields/allfieldsProductInfo/getProductPhoto.do?productcode="+rec.productcode+" ></img>"; 

                 }},

                 {field:'httpurl',title:'httpurl',width:70,align:'left'},
                {field:'orderprice',title:'订货价格',width:70,align:'left',sortable:true},

                {field:'quant',title:'商品上限',width:70,align:'left',sortable:true},
                    {field:'orderunit',title:'订货单位',width:70,align:'left',sortable:true},
                {field:'synchrodata',title:'是否同步',width:70,align:'left',sortable:true},
                 {field:'productSpec',title:'商品规格',width:70,align:'left',sortable:true},             
                {field:'productType',title:'商品类型',width:70,align:'left',sortable:true},
                {field:'packageBarcode',title:'整件条形码',width:70,align:'left',sortable:true},
                {field:'packagePrice',title:'整件价格',width:70,align:'left',sortable:true},
                {field:'packageUnit',title:'整件单位',width:70,align:'left',sortable:true},
                {field:'packageNumber',title:'整件数量',width:70,align:'left',sortable:true},


                {field:'operator',title:'操作人',width:50,align:'left',sortable:true},
                {field:'operateTime',title:'操作时间',width:70,align:'left',sortable:true,formatter:function(value){
                    if(value!=null){
                     return value.substring(0, 19);
                    }else{
                     return null;
                    }
                }},
            ]];
        $('#tablegrid').datagrid({
            singleSelect:false,
            selectOnCheck: true,
            checkOnSelect: true,
            url:'<%=basePath %>allfields/allfieldsProductInfo/findProductInfoPage.do',
            pagination:true,

            pageSize:50,
            idField:"productcode",
            columns:columns,
            striped:true,

            rownumbers:true,
            fit:true,
            toolbar:'#tb',
            pagination:true ,//这里添加分页控件 
            onSortColumn:function(sort,order){
                //alert(sort+","+order);
            var queryParams = {
                sort:sort,
                order:order,
                productdesc:$.trim($("#productdesc").val()),
                hiddenSupplierid_s:$("#hiddenSupplierid_s").val(),
                productcode:$.trim($("#productcode").val()),
                barcode:$.trim($("#barcode").val()),
                startDate:$('#startDate').datebox("getValue"),
                remarkb:$("#remarkb").combobox('getValue'),
                endDate:$('#endDate').datebox("getValue")   
            };
            $("#tablegrid").datagrid( "load" , queryParams );
            $("#tablegrid").datagrid('unselectAll');
            }
    });

2个回答

showbo
showbo   Ds   Rxr 2016.02.23 15:54
已采纳

分页后会自动取消勾选的
不行自己在onLoadSuccess中代码取消

 onLoadSuccess:function(){
  $(this).datagrid('clearChecked')
}
cmrfid_it
cmrfid_it 发现csdn ask里面才是真大神,论坛现在已经不是论坛了,是吹牛逼的地方
6 个月之前 回复
sinat_31535993
sinat_31535993   Rxr 2016.02.23 17:13

分页自动取消勾选,如果想换页还能勾选,配置idField就行了

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!