PDA

View Full Version : Changing the Ext.PagingToolbar displayMsg



baven
13 Oct 2010, 12:17 PM
Hi,
I am currently using Ext.data.GroupingStore and the displayMsg in Ext.PagingToolbar displays total number of rows instead of total number of groups. This is the JSON string :


actionErrors : []
actionMessages : []
...
...
totalCount : 156
totalGroup : 78I just want to display the value of the totalGrp in the displayMsg..but it's displaying totalCount (because of my Ext.data.GroupingStore setup).

//create a grouping store


var _store = new Ext.data.GroupingStore({
reader:new Ext.data.JsonReader({
id: 'mpReader',
root:'mpRoot',
totalProperty:'totalCount',
successProperty : 'success',
messageProperty : 'message',
fields:[
{name: 'mpId'},
.......,
{name: 'groupTag'},
.......
]
}),
proxy:new Ext.data.HttpProxy({
url: readURL
}),
groupField:'groupTag',
remoteSort: true,
listeners:{
load:{scope:this, fn:function() {
alert(_store.reader.jsonData.totalGroup); //this one prints the count correctly = 78
}}
}
});
But I am not able to access that "totalGroup" inside my 'Ext.PagingToolbar'....

//the bottom page bar


var _bbar = new Ext.PagingToolbar({
store: _store,
pageSize: 10000,
displayInfo: true,
emptyMsg: "No data to display",
beforePageText : '',
afterPageText : '',
displayInfo : true,
displayMsg: '<b>Displaying '+?????+' Groups</b>' //what to do here????
});How do I make this work? How do I read the 'totalGroup' straight from the json???

Thanks