如何通过分页删除网格中的滚动条 - Ext JS 4

问题描述 投票:0回答:1

我的应用程序中有一个网格配置为

xtype : 'pagingtoolbar'
,与该网格相关的商店配置为
pageSize : 10
,结果是
pagingtoolbar
正确显示(如下所示),但我有一个滚动条在网格中,并且所有记录都加载到网格中。当然我在网格/商店配置中缺少某些东西: paging toolbar

网格:

xtype : 'gridpanel',
store : mystore,
height : 350,
hidden : true,
columns : [ {
              dataIndex : 'firstName',
              text      : 'First Name',
              flex      : 1
            },{
              dataIndex : 'lastName',
              text      : 'Last Name',
              flex      : 1
            },{
              dataIndex : 'email',
              text      : 'Email',
              flex      : 1  
 }],
 dockedItems : [ {
        xtype : 'pagingtoolbar',
        hight : 28,
                    displayInfo : true,
        dock : 'bottom'
 } ]

商店:

Ext.define('Users',{
   extend: 'Ext.data.Store',
   model: usersModel,
   pageSize : 10,
   proxy: {
             type: 'ajax',
             url: 'servletURL',
             reader: {
                   type: 'json',
                   root: 'data',
                   successProperty: 'success',
                   totalProperty: 'total'
             },
            writer: {
               type : 'json',
               root: 'data' 
    },
    actionMethods: {
        read   : 'POST',
        create : 'POST',
        update : 'POST',
        destroy: 'POST'
    },

},
sortOnLoad: true,
sorters: { property: 'dateTimeTrx', direction : 'DESC' },

});

我正确地从服务器端接收数据,但我无法显示页面,所有数据都在一页中,即使

pagingtoolbar
正确显示如上所示,有什么帮助吗?谢谢!

pagination grid extjs4 store
1个回答
1
投票

ExtJs

pagingtoolbar
不负责从服务器响应中提取所需的数据。相反,您的服务器必须准确地响应应为当前页面显示的数据。为了告诉服务器需要什么数据,ExtJs 会发送额外的参数(类似于
?start=0&page=1&limit=10
)。 您必须根据此参数形成响应。

© www.soinside.com 2019 - 2024. All rights reserved.