I have a spark list control that uses an item renderer (spark itemrenderer) which contains a spark panel. That spark panel uses a custom skin for a collapsing it. Everything works fine to collapse / open the component inside the list. However, i'm trying to collapse all / expand all on click. Any ideas ? I tried overriding the set data function and using an attribute like isCollapsed and setting the panel.skin.currentState to collapsed but that does something weird, it collapses and opens it back up.
Not sure if anybody has any other solutions for that.
If you are adding custom states to an item renderer you will have to override the getCurrentRendererState() method to handle it. You can read more about this in this post:
And here is an example of using DataRenderer instead of ItemRenderer to do something similar: