PDA

View Full Version : Ext 3.1 PagingToolbar Issue



cdg10620
5 Feb 2010, 1:33 PM
I recently updated to Ext 3.1.0 from Ext 3.0.0 and started having the following issue. My grid loads perfectly and holds all of my data but I'm not able to move forward or backwards using the paging toolbar. It is as if the buttons are disabled. Here is some of my code:



createGrid: function(type, title) {
var store = this.createStore( type );

return new Ext.grid.GridPanel({
id: "grid-" + type,
title: title || type,
stripeRows: true,
colModel: this.createColModel(),
selModel: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
store: store,
bbar: new Ext.PagingToolbar( {
store: store,
displayInfo: true,
displayMsg: 'Displaying Users {0} - {1} of {2}',
emptyMsg: 'No records to display'
} ),
listeners: {
cellclick: this.handleCellClick
}
})
},

createStore: function(type) {

return new Ext.data.XmlStore({
storeId: type,
autoLoad: true,
record: "PhoneListEntry",
recordId: "Id",
totalRecords: "TotalSize",
url: "DirectoryService.asmx/GetDirectory",
method: "POST",
baseParams: {
view: type,
start: 0,
limit: 20,
search: ""
},
fields: [ "Id", "LastName", "FirstName", "Location", "Cell", "Org", "Phone", "SpeedDial", "Email", { name: "IsFavorite", type: "boolean" }, { name: "CheckedIn", type: "boolean" } ],
listeners: {
beforeload: {
fn: this.storeBeforeRequest,
scope: this
}
}
});
},


http://mlnixa.blu.livefilestore.com/y1p8lYbPmYz2gd12tGmUcU2XY8qK5H00eWX2QuTQjwGJgJJLFWRlUhSbx9cCjfHE9iA7cIp6ogCFj_ArKeb0Ijp3Yg0nFGjW57E/Capture.JPG
Am I missing something obvious? Any help would be appreciated. Thanks in advance.

aconran
5 Feb 2010, 3:14 PM
Try totalProperty instead of totalRecords.

Invoke getTotalCount() on the Store after it has been loaded. Does it return 20 or the total?

cdg10620
8 Feb 2010, 5:53 AM
Using totalProperty instead of totalRecords solved the issue. Thank you very much for your help.

kennethhui
28 Feb 2010, 11:13 PM
I got the similar case with it.
In my case i am porting extjs from 2.x.x to 3.x.x.
And solved after using totalProperty instead of totalRecords.

Just want to ask when do we using totalRecords then?
Or the totalRecords is no longer in use in extjs-3.X.X? :)