Remote paging grid in extjs

2019-09-07 20:58发布

问题:

You are my last chance :(. Im trying do work a paging grid with mvc pattern. The grid show the fisrt 21 records, but not refresh when click "next" pagingtoolbar icon. All my codes are detailed below:

The Store:

Ext.define('CRUDManantiales.store.grid.AbmUsuarios', {
    extend: 'Ext.data.Store',
    model: 'CRUDManantiales.model.grid.AbmUsuarios',

    proxy: {
        type: 'ajax',
        url: 'resources/bundles/usuarios/generarJsonTodos.php',
        reader: {
            type: 'json',
            root: 'data',
            successProperty: 'success',
            totalProperty: 'total'
        }
    }
});

The main view code:

Ext.define('CRUDManantiales.view.grid.AbmUsuarios', {
    // [..........]
    initComponent: function () {

        this.store = 'grid.AbmUsuarios';
        this.dockedItems = [{
            xtype: 'pagingtoolbar',
            store: this.store,
            beforePageText: 'Página',
            afterPageText: 'de {0}',
            displayMsg: 'Mostrando {0} - {1} de {2} registros',
            emptyMsg: 'No hay datos que mostrar',
            dock: 'bottom',
            displayInfo: true,
            pageSize: 21
        }];
        this.callParent(arguments);
    }
});

I wasted four days in this code, appreciate your assistance. Thanks !!

回答1:

Thanks for all. The problem has been resolute. The fail was that i was using POST array in my PHP script and needed use GET method. :)



回答2:

Refer this link with full explaination of Extjs grid with remote paging

http://blog.techferry.com/2012/01/25/extjs-grid-panel-with-remote-sorting-and-pagination-using-hibernate/