1 Attachment(s)
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.
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
}
});
results in error "namespace is undefined"
2.
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
})
});
results in error "Store is undefined"
Example is attached.
Thanks in advance,
Uli