Golden-layout: Choose parent container for Golden Layout

Created on 14 Oct 2016  路  4Comments  路  Source: golden-layout/golden-layout

Is it possible to attach Golden layout to container rather than it attaching to the body?

I have a tool bar above my layout and need to resize the layout as a whole due to over flow issues.

Thanks

Question

Most helpful comment

Not sure if the API has changed since this ticket, but this can be done directly from the constructor.
var myLayout = new GoldenLayout(config, '#layoutContainer');

All 4 comments

I've attempted to get this to work with no success yet.

It's absolutely possible. I attach my GL to a <div> inside my website (https://gcc.godbolt.org). One must manually tell GL about resizes etc. Code to do so is at https://github.com/mattgodbolt/gcc-explorer/blob/master/static/main.js#L141 and around.

I have found a solution to this -
after creating the layout, set myLayout.container to the container div.

I use the _isFullPage to fill the container div. Essentially setting width and height to 100%

var myLayout = new GoldenLayout(config);
myLayout.container = "#containerDiv";
myLayout._isFullPage = true;

Not sure if the API has changed since this ticket, but this can be done directly from the constructor.
var myLayout = new GoldenLayout(config, '#layoutContainer');

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Raviraj531 picture Raviraj531  路  7Comments

gigamorph picture gigamorph  路  3Comments

maxiplay picture maxiplay  路  4Comments

raptoria picture raptoria  路  8Comments

nreisch picture nreisch  路  7Comments