PDA

View Full Version : [solved] Display total count in a bottom bar



The Transporter
8 Oct 2009, 11:54 AM
Hello,

I'm looking for a way to display the total number of record in a grid.
I tried to add:


bbar: ["Total: "+store.getCount();]But it's always 0, I suppose I have to update it after the store loading... but how to do that ?
Kaigan on irc advice me to use the PagingToolbar but I don't want all the buttons and all that stuff...

Thanks for you help...

jarlau
8 Oct 2009, 5:37 PM
you can use Toolbar.TextItem (http://www.extjs.com/deploy/dev/docs/?class=Ext.Toolbar.TextItem) and then update the value by the store load event.

adibhagra
8 Oct 2009, 11:37 PM
you can do something like this :



yourStore.load({
callback:function(){
var count = yourGrid.getStore().getCount();
var cmessage = "Total number or rows: " + count;

ctext.setText(cmessage); // here ctext is your TextItem

}

all the best , have fun coding

regards,

ice

The Transporter
9 Oct 2009, 2:45 AM
Thanks it's working perfectly :)

adibhagra
9 Oct 2009, 9:22 AM
glad to be of help