1
votes

Is it possible to use the List Paging Plugin in a Nested List? When I place the code directly, the app won't work anymore.

My Code:

requires: ['Ext.field.Search','Ext.Toolbar','Ext.plugin.ListPaging'],
    config: {
        store: 'CatalogStore',
        plugins: [
            {
                xclass: "Ext.plugin.ListPaging",
                autoPaging: true
            }
        ],

My Store :

Ext.define('Catalog_Demo.store.CatalogStore', {
    extend: 'Ext.data.TreeStore',
    requires: ['Catalog_Demo.model.CatalogModel'],
    config :{
        model: 'Catalog_Demo.model.CatalogModel',
        proxy: {
            type: 'ajax',
            url: 'enter code hereosc_demo.php',

            reader:{
                type: 'json',
                rootProperty: 'categories'
                }
            },
        pageSize: 2,
        autoLoad: true,
    }
});

It shows the following error

Uncaught TypeError: Cannot call method 'getScroller' of undefined
ListPaging.js:114

Is there a reason?

1

1 Answers

0
votes

You have to place the plugins config in the listConfig of your nestedList. So the code snippet you posted would turn into something like this:

requires: ['Ext.field.Search','Ext.Toolbar','Ext.plugin.ListPaging'],
config: {
    store: 'CatalogStore',
    listConfig: {
            plugins: [
            {
                xclass: "Ext.plugin.ListPaging",
                autoPaging: true
            }
        ],       
    }
}