Search code examples
apache-flexdynamicdatagridflex3states

changing children of dynamic created states


I'm building an Xml-driven application. I create new states in a seperate actionscript-class. These states all contain a DataGrid. I can switch the states in the Main.mxml.

But now I would like to access certain children of the DataGrid. In this case I would like to toggle the visibility of GridItems, from a Button in the Main.mxml.

How do I have access and apply this to the already created states ? I tried to create RemoveChilds and override/push it to the state. All I archieved was to remove an entire GridRow at the very last state, but it should be just one GridItem at every state.

Thanks a lot for help!


Solution

  • Reverse your problem. Don't try push the information into the states, have the states fetch the information when needed.

    Add a binding in each state to check the status of the button and do the removeChild logic itself.