简体   繁体   English

在网格面板上分页(extjs)

[英]Paging on grid panel (extjs)

I am following the code in the link below to page data on a Ext.grid.Panel without success. 我正在跟踪下面的链接中的代码,无法成功在Ext.grid.Panel上的页面数据。 Data is rendered altogether in the panel without paging. 数据在面板中完全呈现,而没有分页。 Apparently, the paging toolbar has no data to display but it is correctly configured to the store that has the data and it is hanging as an item of the grid. 显然,分页工具栏没有要显示的数据,但已正确配置为具有该数据的商店,并且该商店作为网格的项而挂起。

I have copied the exact configurations of store and grid from the example below but nothing happened. 我从下面的示例复制了store和grid的确切配置,但是什么也没有发生。 Why is the data not being paged? 为什么不分页数据?

http://jsfiddle.net/jardalu/TE4ah/

This is my store which is linked to the grid and the paging toolbar: 这是我的商店,它链接到网格和分页工具栏:

constructor: function(cfg) {
    var me = this;
    cfg = cfg || {};
    me.callParent([Ext.apply({
        pageSize: 50,
        remoteSort: true,
        storeId: 'Users',
        autoLoad: false,
        model: 'AICWeb.model.User',
        sortOnLoad: false,
        proxy: {
            type: 'ajax',
            type: 'localstorage',
            simpleSortMode: true,
            reader: {
                type: 'xml'
            }
        },
        sorters: {
            property: 'email'
        }
    }, cfg)]);
}

If you are using localstorage you need to implement the PagingMemoryProxy . 如果您使用的是localstorage ,则需要实现PagingMemoryProxy This should be the only type on the proxy config, and enable the paging config: 这应该是代理配置上的唯一类型,并启用分页配置:

    proxy: {
        type: 'pagingmemory'
        enablePaging: true,
        ...
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM