PDA

View Full Version : No. of rows within a grid - property?



adibhagra
8 Oct 2009, 12:13 AM
hi ,

is there any grid property that tells the number of rows currently being displayed by the grid.

thanks and regards

ice

Animal
8 Oct 2009, 12:48 AM
The number of visible rows within the scrolled region, or the number of rows currently in the Store, or the size of the total dataset?

adibhagra
8 Oct 2009, 1:10 AM
I mean the total number of rows being displayed by my grid after it loads the store which is getting the data from the database.

maxserv-remco
8 Oct 2009, 1:25 AM
You could try these:



yourGrid.getStore().getTotalCount();


or



yourGrid.getStore().getCount();


Results may vary depending on caching and paging. Check the manual page for the store you're using for more information.

adibhagra
8 Oct 2009, 2:47 AM
nah .. its not working i get a count of 0. i placed this after i fire a load for my gird,but even after my grid loads with the rows the count shows 0. appreciate the help man.


can anyone suggest any other method, i want to display the total count of the rows being displayed by my grid.


regards,

ice

maxserv-remco
8 Oct 2009, 3:05 AM
Remember that loading stores is an asynchronous operation, so if you place this call after the load command, chances are (in my experience about a 100% chance) that the store isn't finished loading when your call is being processed, and so it always will return 0.

You should either place operations like this in the load's callback function or in a 'load' eventHandler to avoid problems like this.

Animal
8 Oct 2009, 3:17 AM
This IS fully explained in the docs. You just need to read them.

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/loaddocs.jpg

adibhagra
8 Oct 2009, 6:40 AM
Thanks a lot guys ..

Yo

Ice