浏览代码

分页bug

yuliang 3 年之前
父节点
当前提交
5259e32489
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 4 2
      src/controls/grid.js
  2. 1 0
      src/controls/stores.js

+ 4 - 2
src/controls/grid.js

@@ -17,6 +17,8 @@ import {
 import {PropertyDescription} from "../PropertyDescription";
 import {gridInvokeBuild} from "./stores";
 
+
+const defaultGrid = grid
 export default function () {
 
     Ext.define('Yvan.Grid', {
@@ -102,7 +104,7 @@ export default function () {
             if (!newConfig.hideFootbar) {
                 if (newConfig.pagination) {
                     newConfig.bbar = new Ext.PagingToolbar({
-                        pageSize: newConfig.pageSize,
+                        // pageSize: newConfig.pageSize, 这个值是无效的
                         displayInfo: true,
                         store: this.store,
                         emptyMsg: '没有记录',
@@ -530,7 +532,7 @@ export default function () {
                                 let v = parseInt(value)
                                 if (isNaN(v) || v === 0) {
                                     window['system'].msg("导出页大小不能为0")
-                                    v = 1000
+                                    v = defaultGrid.exportExcelPageSize
                                     sender.setValue(v);
                                 }
                                 let page = parseInt(grid.exportExcelCurrentPage)

+ 1 - 0
src/controls/stores.js

@@ -17,6 +17,7 @@ export function gridInvokeBuild(scope, grid, config, dataSource, reloadParams =
             remoteSort: config.remoteSort,
             remoteFilter: config.remoteFilter,
             autoLoad: true,
+            pageSize: config.pageSize,
             proxy: {
                 type: 'jsonAjax',
                 $owner: me,