【问题标题】:issue with pagingtoolbar on a livesearchgridpanellivesearchgridpanel上的分页工具栏问题
【发布时间】:2012-10-18 14:24:58
【问题描述】:

我正在尝试在我的 livesearchgridpanel 上设置一个分页工具栏。我通过 Httpproxy 获取数据,所以这是我的商店:

tempStore = new Ext.data.Store
    ({
        groupField     : default_groupby_s,
        model          : 'reportWorkspace',
        allowFunctions : true,
        autoSync       : false,
        pageSize       : 20,
        autoLoad       : true,
        remoteSort     : false,
        proxy          : new Ext.data.HttpProxy
        ({
            url           : url_s,
            actionMethods : 
            {
                read : 'POST'
            },
            reader        : 
            {
                type            : 'json',
                root            : 'workspace_report',
                successProperty : 'success'
            }
        })
    });
return tempStore ;
}

这是我的分页工具栏,它将包含在我的 LivesearchgridPanel 中:

{
    xtype: 'pagingtoolbar',
    store: tempStore ,   
    dock: 'bottom',
    pageSize:20,
    displayInfo: true
}

问题是分页工具栏正确显示页面,但在我的网格的情况下,它同时显示所有数据(在每个页面中)。是否可以在自动加载参数中不设置任何起点或限制的情况下做到这一点? 我只想下载我所有的数据,然后用页面正确显示它

有什么建议吗?

【问题讨论】:

    标签: javascript html extjs4.1 livesearch


    【解决方案1】:

    我发现有几个不一致的地方:

    1. LiveGrid 根本不是为分页而构建的,而是作为它的替代方案。
    2. ExtJS 4.1x 不再使用 HTTP 代理类,而是使用 type: 'ajax' 代理配置。
    3. 如果要对数据进行分页,则需要远程排序,否则就没有意义。
    4. 您必须确保您的网格面板和您的分页工具栏引用同一个商店实例。网格面板中的常见配置是:

    。

    this.dockedItems = [
            {
                xtype:'pagingtoolbar',
                store:this.store, // same store GridPanel is using
                dock:'bottom',
                displayInfo:true
            }
        ];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多