问题描述
- 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'); } });
解决方案
分页后会自动取消勾选的
不行自己在onLoadSuccess中代码取消
onLoadSuccess:function(){
$(this).datagrid('clearChecked')
}
解决方案二:
分页自动取消勾选,如果想换页还能勾选,配置idField就行了
时间: 2024-08-30 09:34:26