1.前台向后台传递数据
属性queryParams,传递json类型的参数给后台
除了queryParams指定参数外,dataGrid默认传递page rows两个参数给后台。
属性url:指定后台数据接口地址
pageSize:指定每页显示数据量
$('#sourceDG').datagrid({
url:"data.json",
pageSize:10,
queryParams: {
source_type: "",
province_load: "",
city_load: "",
county_load: "",
province_delivery: "",
city_delivery: "",
county_delivery: "",
limited: 10,
offset: (curr-1)*10
},
onBeforeLoad:function(param){
console.log(param);
},
onLoadSuccess:function(data){
console.log(data);
},
onLoadError:function(){
console.log(1);
}
});
2.后台向dataGrid传递数据
封装jsonobject
dataGri