View Full Version : GridPanel Update
masudkuet
4 Dec 2006, 6:36 AM
we can use GridPanel to house a grid ...
gridPanel = new YAHOO.ext.GridPanel(grid, ................);
after that we can update this panel with any string 'some str' as follows...
gridPanel.setContent('some str');
which shows string 'some str' instead of the grid.
then how can we show the grid again when we need to show that instead of string 'some str'?
Thanks.
jbowman
4 Dec 2006, 7:44 AM
As I understand it, by using setContent on a grid, you're more or less wiping out the grid entirely. The GridPanel's content is the grip. setContent would remove all of that, and turn the gridPanel's body into the string you pass to it.
I guess the first question is, do you really need to completely wipe out the grid and then get it back to show later?
There is a GridPanel.getGrid() method which will give you access to the YAHOO.ext.grid that is in the GridPanel. You may want to start there.
tryanDLS
4 Dec 2006, 8:03 AM
I would think if you want to have a GridPanel and also show text, you would build 2 different panels and then show/hide the appropriate one.
masudkuet
4 Dec 2006, 11:06 PM
here I tried two ways.....
first, I can hide/show the grid in gridPanel using grid.getEl().hide()/show(). But cannot show other text or table on that place.
second, using two different Panels I can show or hide the appropiate panel using
borderLayoout.getRegion('center').showPanel(gridPanel);
borderLayoout.getRegion('center').hidePanel(msgPanel);
......
but for this I have to add these panels to the borderLayout which creates two different tabs with the two panels. And show/hide panel actually focus the appropriate panel tab.
Is it possible to house the two panel in the same tab and always show one of the panels in that tab?
here gridPanel.getEl().hide() ........ seems not working as expected to hide the gridpanel tab.
Thanks for help.
jbowman
5 Dec 2006, 4:33 AM
One thing to try would be to create two seperate elements, then remove and add panels from the region.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.