简体   繁体   中英

How to hide body of gridpanel?

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?

尝试在网格上调用doLayout()和/或doComponentLayout()

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.

你有没有尝试过

mygrid.collapse();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM