I’m using a custom item renderer in my datagrid, and need to make a button visible or invisible based on if there has been a negative value on any of the values in the renderer. So I’d like to set a flag to false when the first renderer is set off, turn it to true if there’s any negative values, and at the end check for the value of the flag. I know I can dispatch a dataChange event for every time the data is changed in the renderer instances, but I was wondering if there is anyway I can know when all of them are done?
Thanks!
I’m using a custom item renderer in my datagrid, and need to make a
Share
There is no such event.
Like any other Flex component, a renderer will dispatch a
CREATION_COMPLETEafter it’s been created.ItemRenderersare generally recycled (the same object gets assigned new data to render), thus listening forCREATION_COMPLETEis not sufficient, unless you disable the recycling.For a Spark
Listcomponent, you can disable recycling by settinguseVirtualLayout=falseon the layout class. I’m not sure if the SparkDataGridclass support this or not. The MX DataGrid may have some other way to do this.Disabling the recycling, however, can have performance implications. I think your idea w/the
DATA_CHANGEevent is the best solution:dataproperty) to know when the data has changed