peterent was the guru of ItemRenderers, but I haven't seen his posts recently. Anybody know if he's still with Adobe?
So, where are you, flexHarUI, Gregory Lafrance? This question seems like right up your alley.
Nobody wants to take a shot at this?
1 person found this helpful
I would use a singleton or a static variable to hold the lenght of the arraycollection. since they are available evry where, I can access it in the renderer in the set data method and decide what to show.
List.dataProvider = arrayCollection
StaticPublicVarialbeOfThisClass = arrayCollection.length
in the DataRenderer
currentState = ThatClass.StaticPublicVarialbeOfThisClass == 10 ? "10state":"noneState";
I think saisri2k2's suggestion has put me on the right track, although working on this for the past couple of days has not solved the problem.
If anyone wants to look at this, the project is here, http://www.timos.com/LeCreuset/LeCreuset.html and View Source is enabled. The file you want to look at is src > renderers > ProductThumb.mxml.
If you are looking at source, know that I have tried the following:
- the variable ‘filterCount’ as public static;
- the function ‘showsSalePrice()’ inside the get data getter instead of on the dataChange event;
- invalidateProperties() in various places.
None of the above has worked: the filterCount is correct when you select a new category. When you select a category with fewer than 16 products, the tiles change to a state where they are bigger (as they should). But once they have turned bigger, they don not want to return to a state where they should be smaller when you switch to a category with more products. If you try changing categories using the ComboBox you will see this.
So I don’t know what else to try. I have a hunch this may have something to do with the fact that the renderers are recycled when the containing list uses the virtualization (which apparently you can’t turn of in an s:List).
If anyone has any ideas/suggestions, I would love to hear them.
Thanks and greeting to y’all,
Actually it is quite straightforward you just have to "ask the owner" about the length. I posted a small example on my blog have a look: