0

ASP.NET MVC で ExtJS ページング グリッド パネルを使用しています。グリッドにページ番号が表示されないことを除いて、すべて正常に動作しているようです。下部のツールバー ページの 3 つのうち空白にのみ表示されます

これは私の店です:

 Ext.define('EJ.store.Locations', {
     extend: 'Ext.data.Store',
     model: 'EJ.model.Location',
     autoLoad: {
         params: {
             start: 0,
             limit: 5
         }
     },
     pageSize: 5,
     remoteSort: true,
     proxy: {
         type: 'ajax',
         url: '/location/read',
         reader: {
             type: 'json',
             root: 'locations',
             totalProperty: 'totalLocations',
             successProperty: 'success'
         }
     }
 });

これが私の見解です:

Ext.define('EJ.view.location.List', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.locationlist',
    store: 'Locations',
    title: 'All locations',
    autoScroll: true,

    columns: [{
        text: 'Location Id',
        flex: 1,
        sortable: true,
        dataIndex: 'LocationId'
    }, {
        text: 'Name',
        flex: 1,
        sortable: true,
        dataIndex: 'Name'
    }],
    bbar: Ext.create('Ext.PagingToolbar', {
        pageSize: 5,
        store: 'Locations',
        displayInfo: true,
        displayMsg: 'Displaying Locations {0} - {1} of {2}',
        emptyMsg: "No topics to display"

    }),
});
4

1 に答える 1

1

ストアとグリッドを定義し、bbarconfig でまだ作成されていないためストアについて知らない pagingtoolbar をインスタンス化するようです。

遅延読み込みで追加してみてください(bbar構成にすることもできます):

dockedItems: [{
    xtype: 'pagingtoolbar',
    dock: 'bottom',
    pageSize: 5, 
    store: 'Locations',   
    displayInfo: true,
    displayMsg: 'Displaying Locations {0} - {1} of {2}',
    emptyMsg: "No topics to display"
}],
于 2013-01-03T12:20:33.923 に答える