1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /*
- * @Description: 列表store
- * @Author: hy
- * @Date: 2019-08-12 18:34:16
- * @LastEditTime: 2019-08-19 17:16:28
- */
- Ext.define('uas.store.DataListGridStore', {
- extend: 'Ext.data.Store',
- alias: 'store.dataListGridStore',
- model: 'uas.model.DataListGridModel',
- pageSize: 100,
- proxy: {
- type: 'ajax',
- url: '/api/dataList',
- reader: {
- type: 'json',
- rootProperty: 'data.list',
- idProperty: 'id',
- totalProperty: 'data.total'
- }
- },
- autoLoad:true,
- remoteSort: false,
- listeners:{
- beforeload: function (store, op) {},
- load: function(store, records, successful, operation, eOpts) {
- const grid = store.grid;
- const paging = grid.down('[xtype=dataListPaging]');
- const pageCountItem = paging.down('#pageCountItem');
- const dataCount = paging.down('#dataCountItem');
- if(store.totalCount!==Number.MAX_SAFE_INTEGER){
- //展示*号
- if(store.currentPage===Number.MAX_SAFE_INTEGER){
- let page = store.totalCount/store.pageSize;
- page = page>parseInt(page)?page+1:page;
- store.currentPage = page;
- paging.down('#inputItem').setValue(page);
- }
- pageCountItem.update(Ext.String.format(paging.afterPageText,store.currentPage));
- dataCount.setValue("行/共"+store.totalCount+"行");
- }
- }
- }
- });
|