Golden-layout: Set active tab

Created on 20 Jun 2017  路  5Comments  路  Source: golden-layout/golden-layout

Hi,
Currently I do a lot of this:

item.parent.setActiveContentItem(item);

I think an item should have a focus method or something similar to select its tab.

Documentation

Most helpful comment

Will close and add to the list of needed documentation - #269.
We can discuss the helper function in there if needed :)

All 5 comments

Hi!
Try this item.parent.header.parent.setActiveContentItem(item);

Hi @nego25,
The code I posted works, I'm just saying that there should be a helper method.

If I understand this correctly, you are proposing item.focus() or item.setAsActive()?

Not sure this is needed. However if you want to submit a PR then I will be happy to review it and merge.
It makes sense as is - you are selecting the stack and telling it what tab should be active.

Yes, that is what I was talking about. Honestly, it was difficult for me at first because the documentation was not clear.

If you think this helper is not necessary, please add an example on the docs. Thanks.

Will close and add to the list of needed documentation - #269.
We can discuss the helper function in there if needed :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jcford73 picture jcford73  路  7Comments

ldetomi picture ldetomi  路  5Comments

raptoria picture raptoria  路  8Comments

panyam picture panyam  路  4Comments

lstkz picture lstkz  路  5Comments