I’m using spark Lists and PopupAnchors to build a drop down menu system, but I’m having trouble getting it to size reliably – the list always seems to want to take up 5 itemRenderers worth of space, but some of the menus I need to implement can be 3 or less items long. How can I have the list dynamically size to the number of elements in it, and no larger?
I’m using spark List s and PopupAnchor s to build a drop down menu
Share
This is a fun one. You need to set the property on the VerticalLayout of the spark list.
Try this snippet:
This assumes you’ve got a list named yourSparkList and a dataprovider called yourDataProvider which is populating the list.
If your lists get long, you should set a MAXIMUM constant like so:
BTW, there’s also a requestedMaxRowCount and a requestedMinRowCount property.