0

我现在挣扎了几天,但没有成功。我没有通过我的网格进行分页,尽管分页栏显示了页面的数量和数量。这里有一些代码片段:

模型:

Ext.define('TBS', {
    extend: 'Ext.data.Model',proxy: {
        type: 'direct',
        api: {
            create:        QueryDatabase.createRecord,
            read:        QueryDatabase.getResults,
            update:        QueryDatabase.updateRecords,
            destroy:    QueryDatabase.destroyRecord
        },
        simpleSortMode: true
    }...  

店铺:

var store = Ext.create('Ext.data.Store', {
    model: 'TBS',
    autoLoad: true, 
    autoDestroy: true,
    pageSize: 20, 
    remoteSort: false,   
    sortOnLoad: true,
    sorters: { property: 'StartDate', direction : 'DESC' }...

和网格:

var grid = Ext.create('Ext.grid.Panel', {...
    dockedItems: [{
        xtype: 'pagingtoolbar',
        dock: 'bottom',
        store: store,
        pageSize: 20, 
        displayInfo: true,
        displayMsg: 'Total: {2}',
        items: ['-',{
            xtype: 'button',
            iconCls: 'clean',
            text: 'Clear All Filter',
            handler: function () {
                //console.log(Ext.encode(grid.filters.getFilterData()));
                grid.filters.clearFilters();
                store.clearFilter();
            } 
        }]
    }]

我正在使用 ExtJs 4.0.7

任何提示都非常感谢。

谢谢。

4

1 回答 1

0

What does your server return? It's up to your server to return the appropriate amount of records. For example, if it's loading page one, your server should only return the first 20 records. If it's loading page 2, it should only return records 21-40.

于 2012-07-24T07:56:20.787 回答