I had something similar where I wanted to expand the last thing added. You can use toc.expandItem(toc.dataProvider.source,true,true,true,null); where in your case the toc.dataProvider.source part would be the item you want to expand.The real trick for me was that after using toc.expandItem make sure to run toc.validateNow(); or nothing will happen.I thought there is a toc.collapseall or something like that but I can not find it. I found in mine that when something is added it collapses all of them anyways. The command toc.validateNow(); could make that happen.If you have a link to the item (the toc.dataProvider.source) above you can also change its font I think. There is code in there that changes the font for scale dependencies so maybe look for that. Check TocMapLayerItem.mxml.Hope that helps.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.