I'm not quite sure I understand. My dataPrivider is an 
mx:HierarchicalData object, with an ArrayCollection as its source. 
The ArrayCollection is an array of arrays. Something like this:

[
  {name=group1, children=[
    {name=item1},
    {name=item2}
    ]
  },
  {name=group2, children=[
    {name=item3},
    {name=item4}
    ]
  }
]

If I click on "item1" in the grid, I get an rowIndex of 1. What I 
want to find out is that the click refers to item1, and, if possible, 
that item1 is contained in group1.


--- In flexcoders@yahoogroups.com, "Carlos Rovira" 
<[EMAIL PROTECTED]> wrote:
>
> I use this code with an ArrayCollection dataProvider.
> I'm using multiple cell selection as well, but you can customize as 
you
> need:
> 
> var ac:ArrayCollection = dataProvider as ArrayCollection;
> 
>          for(var i:Number = 0; i < selectedCells.length; i++) {
>                 var cell:Object = selectedCells[i];
>                 var data:Object = ac.getItemAt(cell.rowIndex);
>                 var dataField:String = columns
[cell.columnIndex].dataField;
> 
>                 data[dataField] = "";
>                 ac.itemUpdated(data, dataField);
>             }
> 
> aside, selectedIndex and selectedColumnIndex should give you the 
indices you
> need to retrieve a itemRenderer or a datapovider's object
> 
> 
> 
> 2008/7/25 whatabrain <[EMAIL PROTECTED]>:
> 
> >   How can you tell which item in the dataProvider was clicked in 
an
> > AdvancedDataGrid, when using HierarchicalData as the dataProvider?
> >
> > I tried using the typical DataGrid method, of saving off the item 
index
> > in itemRollOver, and using it to determine the index of the 
clicked
> > item. However, with AdvancedDataGrid, the row index isn't 
particularly
> > relevant. Or is there some way to convert the row index to the 
actual
> > clicked item in the dataProvider?
> >
> >  
> >
>


Reply via email to