-
13 Mar 2011 9:41 AM #1
The case of the missing paging toolbar
The case of the missing paging toolbar
Good morning,
I created a grid with a paging toolbar, and when I had it working as planned I created a grid class and registered an xtype. But when I add the xtype to a viewport, the grid populates but the paging toolbar is mysteriously absent. I've spent a few hours on this problem and I'm sure it's something completely obvious I've been overlooking. Below is the grid class and the calling function, with most of the columns and fields excluded.
I really would appreciate another set of eyes. Thanks!
This is the calling function:Code:Ext.ns('NAPP.gridpanel'); NAPP.gridpanel.MainGridPanel = Ext.extend(Ext.grid.GridPanel, { columns: [ { header: "row", dataIndex: 'row', width: 30, sortable: false }, … { header: "rep", dataIndex: 'rep', width: 125, sortable: true } ], viewConfig: { bbar: new Ext.PagingToolbar({ store: this.buildStore, pageSize: 20, displayInfo: true }) }, initComponent: function () { this.store = this.buildStore(); NAPP.gridpanel.MainGridPanel.superclass.initComponent.call(this); }, buildStore: function () { var cookieUtil = Ext.util.Cookies; var uid = parseInt(cookieUtil.get("ud")); var scd = parseInt(cookieUtil.get("scd")); return { xtype: 'directstore', directFn: Direct.Grid.LoadPlan, paramOrder: ['userid', 'scode', 'sort', 'dir', 'start', 'limit'], remoteSort: true, totalProperty: 'total', autoLoad: { params: { start: 0, limit: 20} }, root: 'data', baseParams: { userid: uid, scode: scd }, sortInfo: { field: '0', direction: 'ASC' }, fields: [ { type: 'int', name: 'row' }, … { type: 'string', name: 'rep' } ] }; } }); Ext.reg('maingrid', NAPP.gridpanel.MainGridPanel);
Code:buildGridPanel: function () { return { xtype: 'maingrid', itemId: 'mainGrid', loadMask: true, frame: true, height: 300, width: 400 }; }
-
13 Mar 2011 10:46 AM #2
paging bar showing but not connecting to store
paging bar showing but not connecting to store
I made changes to the code and the paging toolbar loads, but it's not connecting to the store. Any ideas why it's not reading the store?
Code:Ext.ns('NAPP.gridpanel'); NAPP.gridpanel.MainGridPanel = Ext.extend(Ext.grid.GridPanel, { columns: [ { header: "row", dataIndex: 'row', width: 30, sortable: false }, ...{ header: "rep", dataIndex: 'rep', width: 125, sortable: true } ], initComponent: function () { this.store = this.buildStore(); NAPP.gridpanel.MainGridPanel.superclass.initComponent.call(this); }, bbar: new Ext.PagingToolbar({ store: this.store, pageSize: 20, displayInfo: true, emptyMsg: 'no records' }), buildStore: function () { var cookieUtil = Ext.util.Cookies; var uid = parseInt(cookieUtil.get("ud")); var scd = parseInt(cookieUtil.get("scd")); return { xtype: 'directstore', directFn: Direct.Grid.LoadPlan, paramOrder: ['userid', 'scode', 'sort', 'dir', 'start', 'limit'], remoteSort: true, totalProprty: 'total', autoLoad: { params: { start: 0, limit: 20} }, root: 'data', baseParams: { userid: uid, scode: scd }, sortInfo: { field: '0', direction: 'ASC' }, fields: [ { type: 'int', name: 'row' }, ...{ type: 'string', name: 'rep' } ] }; } }); Ext.reg('maingrid', NAPP.gridpanel.MainGridPanel);
-
13 Mar 2011 9:31 PM #3
Try this:
Remove bbar property and assign it inside initComponent()
Code:initComponent: function () { this.store = this.buildStore(); Ext.apply(this, { bbar: new Ext.PagingToolbar({ store: this.store, pageSize: 20, displayInfo: true, emptyMsg: 'no records' }) }; NAPP.gridpanel.MainGridPanel.superclass.initComponent.call(this); }Greivin Britton
My Extensions:
Ext.ux.NumericField: Number field with support for currencySymbol, thousand separator, international...
Ext.ux.PagerSizeSelector: A plugin that allows the change page size with just one click.
Ext.ux.FieldAccess: A plugin to let the user know which fields are editable.
-
14 Mar 2011 9:54 PM #4
Thank you!
Thank you!
Greivin,
Thank you for taking the time to respond to me. Sometimes I get so wrapped up in a problem I'm unable to see the solution. An extra set of eyes always helps!
-
15 Mar 2011 7:52 AM #5
That's so true...
Greivin Britton
My Extensions:
Ext.ux.NumericField: Number field with support for currencySymbol, thousand separator, international...
Ext.ux.PagerSizeSelector: A plugin that allows the change page size with just one click.
Ext.ux.FieldAccess: A plugin to let the user know which fields are editable.
Similar Threads
-
TextField - force lower case entries to upper case?
By Bucs in forum Ext 3.x: Help & DiscussionReplies: 7Last Post: 30 Jun 2010, 3:07 AM -
Updating image on toolbar button and paging toolbar issues
By Jangla in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 9 Jul 2009, 1:21 AM -
[FIXED][3.x] Ext.form.ComboBox + Paging Toolbar errors when using remote paging
By jay@moduscreate.com in forum Ext 2.x: BugsReplies: 3Last Post: 15 Feb 2009, 4:54 PM -
paging case of ArrayReader ?
By newinext in forum Ext 1.x: Help & DiscussionReplies: 4Last Post: 13 Aug 2007, 4:03 AM -
[RESOLVED - ajax method: in config is now case sensitive] Paging broken in 1.1 beta?
By auroraeosrose in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 28 Jun 2007, 6:23 AM


Reply With Quote