window 里面加载datagrid
<div id="detail" class="easyui-window" style="width:820px;height:450px" title="xxx">
<div id="detaildata"></div></div>
function pdetail(){
$("#detaildata").datagrid({
url:path+"/xxx/xxx,//加载的URL
idField:"id",
pagination:true,//显示分页
pageSize:5,//分页大小
pageList:[5,10,15,20],//每页的个数
fit:true,//自动补全
fitColumns:false,
remoteSort:false, // 滚动条属性, remoteSort:false
iconCls:"icon-save",//图标
title:"xxx",
columns:[[ //每个列具体内容
/* {field:'id',checkbox:true}, */
{field:'id',title:'xxx', width:100,sortable:true}, // 排序属性,sortable:true
{field:'xxx',title:'xxx', width:200,sortable:true},
{field:'xxx',title:'xx',width:100,
formatter:function(value,row,index){
var flag="";
if(row.xxx==0){
flag="1";
}else if(row.xxx==1){
flag="2";
}
return flag;
}},
{field:'date_time',sortable:true,title:'发生时间',
formatter:function(value,row,index){
var unixTimestamp = new Date(value);
return unixTimestamp.toLocaleString();
}
}
]],
onLoadSuccess: function (data) {
$("#detail").window('open');
},
onLoadError:function(data){
alert("查询失败");
}
})
}
分页后台page 里面放 list 和list.size