$(p).pagination({
pageSize: 3,//每页显示的记录条数,默认为10
pageList: [3,6,9],//可以设置每页记录条数的列表
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录'
});
$('#run_storage21803Div').datagrid({
method : 'GET',
//url : "${ctxBase}/static/modules/run/run_storageManage/run_storageList/run_storageList3703.json",
url : "${ctxBase}/login/run/storageFabricSwitchList",
pagination : true,//分页控件
pageSize: 3,//每页显示的记录条数,默认为10
pageList: [3,6,9],//可以设置每页记录条数的列表
loadMsg: "数据加载中...",// 等待数据加载时的消息提示
fit:true,
columns : [ [{
field : 'resourceId',
title : 'resourceId',
width : "3%",
hidden: true,
align : 'center'
},{
function searchFn(){
$('#run_serverList35Div').datagrid('load',{
key:$('#search').val()
});
}
-----------------------------------------------------------------------------------------------------------------------------------------
public static Map<String,String> getMap(Object thisObj)
{
Map<String,String> map = new HashMap<String,String>();
Class<?> c;
try
{
//通过反射实现获取对象
c = Class.forName(thisObj.getClass().getName());
//获取对象中get的方法
Method[] m = c.getMethods();
for (int i = 0; i < m.length; i++)
{
String method = m[i].getName();
if (method.startsWith("get"))
{
try{
//通过函数名反射相应的函数
Object value = m[i].invoke(thisObj);
if (value != null)
{
//根据get方法获取字段
String key=method.substring(3);
key=key.substring(0,1).toUpperCase()+key.substring(1);
map.put(key, (String) value);
}
}catch (Exception e) {
logger.info("error:"+method);
}
}
}
}