PDA

View Full Version : PagingToolbar "Results 1 - 10 of 20" As Grid Title?



inviba
1 Sep 2009, 7:55 AM
Hi All

I want to show the number of results as the title of a grid. The exact text I want to show it the same as displayMsg config option of Ext.PagingToolbar.

I have a solution that works, but I am wondering if there is a better way?



new Ext.PagingToolbar({
pageSize: 25,
store: store,
displayInfo: true,
displayMsg: '<div id="bbarT">'+module.grid.pager+' {0} - {1} of {2}</div>',
emptyMsg: '<div id="bbarT">0 '+module.grid.pager+'</div>',
plugins: [filters],
listeners: {
change: function(e) {
var title = Ext.getDom('bbarT').innerHTML;
Ext.getCmp('grid').setTitle(title);
}
}
})


Thank You

8 Sep 2009, 4:01 AM
setup a 'load' listener on the grid's data store to set the title accordingly.