0 Replies Latest reply on Sep 24, 2009 9:04 AM by Handycam

    Delete button for row in grouping collection/advanced data grid?

    Handycam Level 1

      I have a "delete this row" working for a standard datagrid, thanks to Greg LaFrance's Flex Cookbook and Google Cache.



      <mx:DataGrid id="testGrid" dataProvider="{menuListCollection}" width="100%" height="100%">
           <mx:DataGridColumn dataField="title"/>
           <mx:DataGridColumn headerText="Delete Item">
           <mx:LinkButton label="Delete" click="outerDocument.deleteItem(event)"/>



      public function deleteItem(event:MouseEvent):void{      
           menuListCollection.refresh(); }


      My problem is, this doesn't work for an Advanced Data Grid with a Grouping collection on it.  The selected index for the child (grouped) items is -1:




      Also, I want to delete individual items, not the group.  I would assume deleting the last member of a group effectively removes the group?


      How do I do this?