日期:2014-05-16 浏览次数:20644 次
var caseGrid = new Ext.grid.GridPanel({ frame:true, //region:'north', title:'Testcase Grid', width:700, height:300, viewConfig:{ forceFit:true }, loadMask:true, store:case_list_store, cm: cm, //sm: sm, bbar: new Ext.PagingToolbar({ pageSize : 30, store: case_list_store, displayInfo: true, displayMsg: 'display from {0} to {1} testcase, total {2}', emptyMsg: "No testcase" }) }); case_list_store.load({params:{start:0,limit:30}});
------解决方案--------------------
接楼上,在后台这样写
public void doPost(reqeust,response){ String str_start = reqeust.getParameter("start"); String str_limit = reqeust.getParameter("limit"); 第一次请求 会接收到 str_start = 0; str_limit=30 第二次收到str_start = 30; str_limit=30 三次str_start = 60; str_limit=30 以此类推 具体怎么分页你就随便选择了 }
------解决方案--------------------
前台:
var guestrecord = Ext.data.Record.create( [ {name:'guest_id',type:'string'}, {name:'guest_name',type:'string'}, {name:'guest_clerk',type:'string'}, {name:'guest_clerk_part',type:'string'} ] ); var store = new Ext.data.Store({ proxy:new Ext.data.HttpProxy({url:'select.action',method:'post'}), reader:new Ext.data.JsonReader({totalProperty: 'totalInfos',root:'guests'},guestrecord), baseParams:{start:0,limit:20} });