0
votes

I'm struggling for days now, but with no success. I got no paging through my grid, though the pagingbar shows amount and count of pages right.Here are some code snippets:

model:

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
    }...  

store:

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

and the grid:

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();
            } 
        }]
    }]

I'm using ExtJs 4.0.7

Any hints are very appreciated.

Thx.

1

1 Answers

0
votes

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.