PDA

View Full Version : How can I calculate the grid's total height?



maya
7 Jul 2007, 3:05 AM
Hi,

How can I calculate the grid's total height?
The grid's total width can be calculated using: colModel.getTotalWidth();
Is there also a method getTotalHight()?

Thanks,
Maya

ToNiC
7 Jul 2007, 11:11 AM
You can get the grids container height by grid.container.getHeight()

OR

To get the grid's DOM height, you can try: Ext.get('grid-ref').dom.clientHeight

maya
7 Jul 2007, 11:26 AM
Thanks for your reply, but I am looking for the total row height sum.

If I use the grid div's height, or its container div's height, I get only the height of the grid's borders (e.g., height=200px). BUT - if the rows total height is larger than 200px, they are scrolled vertically. In this case I can't know their real height sum (e.g., 400px) - only the height seen on the screen (200px).

Any ideas?

ToNiC
7 Jul 2007, 11:42 AM
Ohh I see what your saying now.

Something about scrollHeight and scrollTop comes to mind

Edit: Looks like if you can get the reference to the scrollbar of the grid you can get the height by: Ext.get('scroll-ref').dom.scrollHeight

maya
8 Jul 2007, 2:49 AM
Isn't there something in Ext equivalent to cm.getTotalWidth()?