-
16 Aug 2011 3:45 AM #1
Answered: Add pager to list in sencha MVC-example
Answered: Add pager to list in sencha MVC-example
Hi,
how can I add a pager in a grid-panel if MVC-architecture is used? I copied the files from Ext-4.0/examples/app/simple and successfully ran the example.
Then I added a paging-toolbar as bbar-attribute in 'AM.view.user.List' using two different methods:
1.
results in error "namespace is undefined"Code:Ext.define('AM.view.user.List' ,{ extend: 'Ext.grid.Panel', alias : 'widget.userlist', title : 'All Users', store: 'Users', columns: [ {header: 'Name', dataIndex: 'name', flex: 1}, {header: 'Email', dataIndex: 'email', flex: 1} ], bbar: { xtype: 'paging', store: 'Users', displayInfo: false } });
2.
results in error "Store is undefined"Code:Ext.define('AM.view.user.List' ,{ extend: 'Ext.grid.Panel', alias : 'widget.userlist', title : 'All Users', store: 'Users', columns: [ {header: 'Name', dataIndex: 'name', flex: 1}, {header: 'Email', dataIndex: 'email', flex: 1} ], bbar: Ext.create('Ext.toolbar.Paging', { store: 'Users', displayInfo: false }) });
Example is attached.
Thanks in advance,
UliLast edited by fishbone; 16 Aug 2011 at 3:46 AM. Reason: typo
-
Best Answer Posted by skirtle
The xtype for a paging toolbar is pagingtoolbar, not paging. Worked for me when I changed it.
-
16 Aug 2011 3:22 PM #2
The xtype for a paging toolbar is pagingtoolbar, not paging. Worked for me when I changed it.
-
19 Aug 2011 4:08 AM #3
@skirtle
Where do you know this from? The xtype is said to be "paging" in the docs... Should I file a bug ticket?
http://docs.sencha.com/ext-js/4-0/#/api/Ext.Component
-
19 Aug 2011 9:57 AM #4
I got it from here:
http://docs.sencha.com/ext-js/4-0/#/...toolbar.Paging
Top of the page.
You appear to be correct, there is a mistake. There's a special thread for reporting documentation bugs here:
http://www.sencha.com/forum/showthread.php?135037


Reply With Quote