我正在使用 mx:tree 控件,需要在运行时动态填充树节点。这是我所拥有的:
var ac:ArrayCollection = new ArrayCollection();
ac.addItem({ item: "Parent Item", group: "Group 1"});
ac.addItem( { item: "Parent Item", group: "Group 2" } );
var childac:ArrayCollection = new ArrayCollection();
childac.addItem({ item: "Child Item", group: "Group 1"});
//not sure how to add the childac to the ac
trvMain.dataProvider = ac;
如何将子数组集合附加到父数组集合,以便树视图正确显示层次视图?