This article describes how to use the pagination in the next Extjs4 and combine front and rear, specific examples such as, interested friends can refer to the following
The front section: code is as follows: Ext.define (' GS.system.role.store.RoleGridStore ',{ extend: ' Ext.data.Store ', model: ' GS.system.role.model.RoleGridModel ', ID: ' Rolestoreid ', pagesize:4,//paging size proxy:{ type: ' Ajax ', URL: '/gs_erp/roleaction!getrolelist ', reader: { type: ' JSON ', root: ' Rows ', Totalproperty: ' Total ' } }, sorters: [{ property: ' ID ',///Sort field Direction: ' ASC '//default Asc&nbs P }], autoload:{start:0, Limit:4}//start is starting from the first few, limit is the number of pages per page }); store.loadpage (1); Load first page Background section: code as follows: Private int limit;//The number of bars private int start;//from which data to check private int total;// Total number /** * Find all roles */ public void getrolelist () { list<role> rolelist=new A Rraylist<role> (); stringbuffer tojson=new stringbuffer ()//To put JSON data SYSTEM.OUT.PRINTLN (start+) "+limit+", "+total"; try { rolelist= (list<role>) PAGeserviceimpl.commonpagination (Role.class, "", Start, limit); Total=pageserviceimpl.gettotalnum (Role.class, " "); Tojson.append (" {total: "). Append (" +total+ "). Append (", Success:true, "). Append (" Start: ") Append (" "+start+"). Append (","); tojson.append ("rows:["); for (int i=0;i<rolelist.size (); i++) { Tojson.append ("{ID:"). Append (""). Append ("" +rolelist.get (i) getId () + ""). Append ("") . Append (", Name:"). Append (""). Append ("" "+rolelist.get (i) getName () +" ") Append (" ' "). Append (", desc: "). Append (" ") Rolelist.get (i). GetDesc () + "") Append ("'"). Append ("}"); if (I<rolelist.size ()-1) { Tojson.append (","); } } tojson.append ("]}"; } catch (Exception E1) { //TODO Auto-ge Nerated catch block e1.printstacktrace (); } try { response.setheader ("Cache-Control", " No-cache "); response.setcontenttype (" Text/json;charset=utf-8 "); Response.getwriter(). Print (Tojson); System.out.println (Tojson); } catch (IOException e) { //TODO auto-generated Catch block e.printstacktrace (); } }