Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Is it possible to dynamically change the orientation of a layout?

$
0
0
Hi,

I want to make a Layout that behaves like a VLayout when in portrait mode and a HLayout in landscape mode. I tried using the following code, but it has no effect:
Code:

isc.Layout.create({ID:"layout", autoDraw:false, members:[pane1, pane2]});
function oChange() {
  if (isc.Page.getOrientation() == "portrait")
    layout.orientation = "vertical";
  else if (isc.Page.getOrientation() == "landscape")
    layout.orientation = "horizontal";
  layout.reflow();
}
isc.Page.setEvent("orientationChange", oChange);

My function gets called when orientation is changed, but doesn't seem to have any effect. I have also tried calling layout.layoutChildren() and layout.redraw() to no avail.
Is it possible to achieve what I'm trying to do?

regards,
Andrew

Viewing all articles
Browse latest Browse all 4756

Trending Articles