Hello... that is good example but problem i faced, when child value is came in certain criteria then only that expand... please help me howz that possible?
On Feb 11, 12:22 am, vrathore <[email protected]> wrote: > Use the following application, here i have used open items casting the > dataprovider to IHierarchicalCollectionView. > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="vertical" creationComplete="init()"> > <mx:Script> > <![CDATA[ > import mx.collections.IHierarchicalCollectionView; > > private function init():void > { > gc.refresh(); > adg.dataProvider = gc; > > IHierarchicalCollectionView(adg.dataProvider).openNodes = gc.getRoot > (); > } > > // counter to maintain the uid > private var count:int = 0; > > private function grpObjFunc(value:String):Object > { > // we need to assign the same uid for same grouped > Objects > // use count or value + count > return {uid:value + count++}; > } > > ]]> > </mx:Script> > > <!-- Source Collection --> > <mx:ArrayCollection id="arr"> > <mx:Object name="A" qty="5" cost="100" /> > <mx:Object name="A" qty="10" cost="200" /> > <mx:Object name="B" qty="4" cost="200" /> > <mx:Object name="C" qty="3" cost="300" /> > <mx:Object name="C" qty="5" cost="350" /> > <mx:Object name="D" qty="2" cost="400" /> > <mx:Object name="E" qty="1" cost="500" /> > </mx:ArrayCollection> > > <!-- Grouping Collection taking source as the ArrayCollection defined > above--> > <mx:GroupingCollection id="gc" source="{arr}"> > <mx:Grouping groupingObjectFunction="grpObjFunc" > > <mx:fields> > <mx:GroupingField id="gf" name="name" /> > </mx:fields> > </mx:Grouping> > </mx:GroupingCollection> > > <!-- Array of Summaries, to be assigned when summaries are needed --> > <mx:Array id="summ"> > <mx:SummaryRow> > <mx:fields> > <mx:SummaryField dataField="cost" operation="SUM" /> > </mx:fields> > </mx:SummaryRow> > </mx:Array> > > <mx:AdvancedDataGrid id="adg" dataProvider="{gc}" height="300"> > <mx:columns> > <mx:AdvancedDataGridColumn dataField="name" /> > <mx:AdvancedDataGridColumn dataField="qty" /> > <mx:AdvancedDataGridColumn dataField="cost" /> > </mx:columns> > </mx:AdvancedDataGrid> > > </mx:Application> > > Cheers > > Varun Rathore --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

