easyui datagrid 查询 分页

$('#list').datagrid({
width:'auto',
height:'auto',
striped: true,
loadMsg:'数据加载中请稍后……',
fitColumns: false,
pagination: true,
nowrap:true,
   url:'<%=request.getContextPath()%>/LvwanVehicleSearchAction/LvwanHistorySearch',
   columns: [[
       {field:'remark',title: '查询状态', index:'remark', align:'center'},
      {field:'idNumber',title: '身份证号码', index:'idNumber', align:'center'},
      {field:'idNumberReslut',title: '查询结果', index:'idNumberReslut', align:'center', formatter:function(value,row,index)
     {
      if(value=='1'){
      return '一致';
      }else if(value=='0'){
      return '不一致';
      }else if(value=='-1'){
return '不存在';
      }else{
return '';
      }
}}            ]]
});

})     通过后台加载数据   

搜索的时候 需要调用  

var data = new Object();
var map = {
key:value,     搜素的条件  

key:value
};

data["paramJsonMap"] = JSON.stringify(map);   这个是后台接收的参数     


$("#list").datagrid("load",data);    

后台通过paramJsonMap 接收到参数   

// 设置查询条件
HashMap map = new HashMap();
ObjectMapper om=new ObjectMapper();
if(paramJsonMap!=null&&!paramJsonMap.equals("")){
map = (HashMap) om.readValue(paramJsonMap, Map.class);
}

这样搜索的参数就放到map里面了 

你可能感兴趣的:(技术,easyui,数据,分页,datagrid)