日期:2014-05-16 浏览次数:20920 次
//初始化grid var grid = null; //查询信息 var store = new Ext.data.Store({ //proxy: new Ext.data.HttpProxy({url:'../system/sysparamList!query.icode?flag=extjs&recordCount=<s:property value="pageAttribute.recordCount"/>&pageCount=<s:property value="pageAttribute.pageCount"/>&pageNo=<s:property value="pageAttribute.pageNo"/>&maxResults=<s:property value="pageAttribute.maxResults"/>&startPosition=<s:property value="pageAttribute.startPosition"/>'}), proxy: new Ext.data.HttpProxy({url:'../system/sysparamList!query.icode'}), reader:new Ext.data.JsonReader({ root:'jsonarray', totalProperty:'totalCount', id:'paramid' }, storeRecord), method:'post' }); grid = new Ext.grid.GridPanel({ renderTo:"mainDiv", //grid查询结果指向显示的div层 title:"用户查询结果", //grid标题 autoHeight : true, cm:colM, //定义的列 store:store, //定义的数据源 bbar: new Ext.PagingToolbar({ pageSize: 20, store: store, params : { start : 'start', limit : 'limit' }, displayInfo: true, displayMsg: '第{0} 到 {1} 条数据 共{2}条', emptyMsg: "没有数据" }) }); store.load({params:{start:0, limit:20}});
db = new DBOperation(); dao = new SysparamDAO(db); sysparamList = doQuery(); response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/json;charset=UTF-8"); JSONArray json = JSONArray.fromObject(sysparamList); String jsonarray = json.toString(); jsonarray = "{\"totalCount\":\"" + sysparamList.size()+ "\",\"jsonarray\":" + jsonarray + "}"; System.out.println(jsonarray); response.getWriter().write(jsonarray);
{"totalCount":"20","jsonarray":[{"data":"","fmt":"","gcode":"TRVL_DORM","id":469,"mcode":"0","mname":"酒店","scope":0,"sort":0},{"data":"","fmt":"","gcode":"TRVL_TRAFFIC","id":472,"mcode":"0","mname":"飞机","scope":0,"sort":0},{"data":"","fmt":"","gcode":"PRV_MARRY","id":289,"mcode":"0","mname":"未婚","scope":0,"sort":0},xxx,xxx,xxx……]}
store_ElectriPrice = Ext.create('Ext.data.Store',{ pageSize: 20, model: 'ElectriPrice', autoLoad: true, proxy: {