I'm using a standard jQuery layout (north, south, west, east and center) as indicated in the site documentation.
For both my west and center panels, I have a header and footer pane.
Everything is working correctly except that now I needed to temporarily 'hide' the header and/or footer, to eventually show them again at some point.
Since I'm not aware of a way to programmatically hide/show the header and footer panes, I'm reverting to basic jQuery.
I created the following function:
// action = hide, show
// panel = center, east, west
// pane = header, footer
function setPaneState(action, panel, pane) {
if (action) {
switch (action) {
case 'hide':
$(".ui-layout-" + panel + " > .ui-layout-" + pane).hide();
break;
case 'show':
$(".ui-layout-" + panel + " > .ui-layout-" + pane).show();
break;
}
}
}
And I call it this way:
setPaneState('hide', 'center', 'header');
and
setPaneState('show', 'center', 'header');
Everything works well except that when I hide the header, the footer moves up by the equivalent space. The center panel does not seem to 'refresh' or 'redraw' itself. I would like the panel which gets altered to be redrawn correctly, but I'm not sure how to tell jQuery layout how to do that.
I know that jQuery layout provides the following API to hide/show panels.
layout.hide(panel); // Where 'panel' is one of: 'north', 'south', 'east', or 'west'
But nothing seems to exist for panes (header/footer).
Note that layout.resizeContent("west");
as documented here, doesn't seem to work, throwing Uncaught TypeError: layout.resizeContent is not a function
exception.
Any help is appreciated.
Update: I've found that this layout.sizePane('north', 100);
actually works though.
By the way, I'm using jquery.layout 1.4.3