DataGroup item removed event
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:s="library://ns.adobe.com/flex/spark"> <mx:Script> import spark.events.RendererExistenceEvent; import mx.collections.ArrayCollection; import mx.controls.Alert; private function itemAdded( evt:RendererExistenceEvent ):void { Alert.show(evt.index + " : " + evt.data + " : " + evt.renderer ); } private function itemRemoved( evt:RendererExistenceEvent ):void { Alert.show(evt.index + " : " + evt.data + " : " + evt.renderer ); } private function addItem():void { if( collection.length > 0 ) myContent.dataProvider.addItem( collection.removeItemAt(0) ); } private function removeItem():void { if( myContent.dataProvider.length > 0 ) { var item:Object = myContent.dataProvider.removeItemAt( myContent.dataProvider.length - 1 ); collection.addItem( item ); } } </mx:Script> <mx:String id="txt">this is a test</mx:String> <mx:ArrayCollection id="collection"> <mx:Label text="Using DefaultComplexItemRenderer." /> <mx:Button label="button 1" /> <s:DropDownList dataProvider="{new ArrayCollection(txt.split(' '))}" /> <mx:CheckBox selected="true" /> </mx:ArrayCollection> <s:DataGroup id="myContent" rendererAdd="itemAdded(event);" rendererRemove="itemRemoved(event);" itemRenderer="spark.skins.spark.DefaultComplexItemRenderer"> <s:dataProvider> <mx:ArrayCollection /> </s:dataProvider> </s:DataGroup> <mx:Button label="add" click="addItem();" /> <mx:Button label="remove" click="removeItem();" /> </mx:Application>