recently, I research for the collection framework, and find LinkedSet(AS3Commons collection framework,it is a good opensource framework) written in ActionScript, but it can't use as dataProvider in ComboBox or DataGrid, because only implemen开发者_开发技巧ts ICollectionView can use as dataProvider. So I want to try if a class implements ICollectionView can work or not. I know Flex has build-in class implements ICollectionView, but I only want to define a class not use build-in class. The class as simple as possible.(can work is enough)
Call toArray
on your LinkedSet
and wrap it with mx.collections.ArrayCollection
which implements ICollectionView
, then hand that off to the ComboBox
.
This works for any component that doesn't need to alter the underlying data structure. If you need to directly alter your Set via the controls, and copying to and from an Array isn't sufficent, you'll need to write your own implementation for ICollectionView
and IViewCursor
that wrap AS3CC's ICollection or whatever other class as you desire.
精彩评论