I want the last map service name added to the TOC MapSwitcherWidget to expand after the map/layer is added.
I can get all of them to expand using this
this.toc.expandLayerItems();
But I have tried all kinds of code to get that last item added to open but nothing works. It seems like one of these should work but it does not.
toc.expandChildrenOf(toc.firstVisibleItem,true);
toc.expandItem(toc.firstVisibleItem,true);
Forgot to add tried this also
this.toc.openItems.push(toc.firstVisibleItem);
Any ideas?
Thanks.
I can get all of them to expand using this
this.toc.expandLayerItems();
But I have tried all kinds of code to get that last item added to open but nothing works. It seems like one of these should work but it does not.
toc.expandChildrenOf(toc.firstVisibleItem,true);
toc.expandItem(toc.firstVisibleItem,true);
Forgot to add tried this also
this.toc.openItems.push(toc.firstVisibleItem);
Any ideas?
Thanks.