Jquery EasyUI datagrid分页

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
       <table id="people_datagrid"></table>
</body>
</html>
//显示人员列表的方法
function peopleList(buildingId, selectFloor, selectRoom, pSex,peopleNameOrIdentity) {
	$('#people_datagrid').datagrid({
		title : '人员列表',
		nowrap : true,// 在数据满行 后是否自动截取
		height : 360,
		rownumbers : true,// 显示行数
		pageSize : 10,// 显示多少条记录
		striped : true,
		// fitColumns:true, //适度列宽
		singleSelect : true,
		collapsible : true,
		// url:ctxPath+'/peopleController/searchFloorPeople.action?id='+buildingId+'&selectFloor='+selectFloor+'&selectRoom='+selectRoom+'&pSex='+pSex+'&peopleNameOrIdentity='+peopleNameOrIdentity,
		url : ctxPath
				+ '/peopleController/searchFloorPeople.action?id='
				+ encodeURI(buildingId) + '&selectFloor='
				+ encodeURI(selectFloor) + '&selectRoom='
				+ encodeURI(selectRoom) + '&pSex='
				+ encodeURI(pSex) + '&peopleNameOrIdentity='
				+ encodeURI(peopleNameOrIdentity),
		remoteSort : false,
		idField : 'id',
		pagination : true,
		striped : true,
		sortName : 'id',
		sortOrder : 'asc',
		onLoadSuccess : function(data) {
			if (data.total == 0) {
				/*
				 * $.messager.show({ title:'信息提示',
				 * msg:'没有找到相应信息!', showType:'show' });
				 */
			}
		},
		columns : [ [
			{
				title : '姓名',
				field : 'NAME',
				width : 48,
				sortable : true,
				align : 'left'
			},
			{
				title : '性别',
				field : 'SEX',
				width : 30,
				sortable : true,
				align : 'left'
			},
			{
				title : '身份证',
				field : 'IDENTITY_CARD',
				width : 120,
				sortable : true,
				align : 'left'
			},
			{
				title : '出生日期',
				field : 'BIRTHDAY',
				width : 67,
				sortable : true,
				align : 'left'
			},
			{
				title : '民族',
				field : 'NATION',
				width : 38,
				sortable : true,
				align : 'left'
			},
			{
				title : '联系电话',
				field : 'LINK_TEL',
				width : 70,
				sortable : true,
				align : 'left'
			},
			{
				title : '定位',
				field : 'ID',
				align : 'center',
				formatter : function(value, rowData,
						rowIndex) {
					return '<span style="color:blue"><a style="text-decoration: none;" href="javascript:peopleloc('
							+ buildingId
							+ ','
							+ value
							+ ');">详细信息</a>';
				},
				width : 60,
				align : 'left'
			} ] ]
	});
}

相关推荐