Foreground: Extdefine (& 039; GSsystemrolestoreRoleGridStore & 039;, {extend: & 039; ExtdataStore & 039;, model: & 039; Region & 039;, id: & 039; roleStoreId & 039;, p
Foreground:
Ext. define ('gs. system. role. store. roleGridStore ', {extend: 'ext. data. store', model: 'gs. system. role. model. roleGridModel ', id: 'rolestoreid', pageSize: 4, // page 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}], autoLoad: {start: 0, limit: 4} // start starts from the number of rows, limit is the number of entries per page });Store. loadPage (1); // load the first page
Background:
Private int limit; // The number of lines on each page. private int start; // The data starting from which the private int total is queried; // total number of entries/*** search for all roles */public void getRoleList () {List
RoleList = new ArrayList
(); StringBuffer toJson = new StringBuffer (); // used to store the json data System. out. println (start + "," + limit + "," + total); try {roleList = (List
) 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