2013-04-04 112 views
1

是否可以在嵌套列表中使用列表分頁插件?當我直接放置代碼時,應用程序將不再工作。在嵌套列表中列表分頁

我的代碼:

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

我的商店:

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, 
    } 
}); 

它顯示了以下錯誤

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

有什麼原因嗎?

回答

0

您必須將插件配置放置在nestedList的listConfig中。所以你發佈的代碼片段會變成這樣的:

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