2

My grid have some docked toolbars and i want to hide only grid body. I tried to hide like this:

mygrid.body.hide();

rows disappeared but container height not changed. So instead grid rows I got empty space..

So how can I collapse and expand gridpanel body?

Darin Kolev
  • 3,401
  • 13
  • 31
  • 46
Vytautas
  • 3,509
  • 1
  • 27
  • 43

3 Answers3

0

Try calling doLayout() and/or doComponentLayout() on grid

sha
  • 17,824
  • 5
  • 63
  • 98
  • in firebug i see that style has changed(highlighted) so somehow extjs counts and hidden elements heights? – Vytautas Apr 13 '12 at 12:28
0

You can try like this:

  • Hide the headercontainer of the grid with hide(), if needed (this contains the grid header row)
  • Hide the body of the grid with hide() as you did.
  • Set the height of grid to appropriate value: grid.setHeight(grid_header_height + grid_toolbar_height). Plus grid_headercontainer_height to if needed.
U and me
  • 730
  • 5
  • 13
0

Have you tried

mygrid.collapse();
Geo
  • 12,666
  • 4
  • 40
  • 55