• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1880
  • Last Modified:

how to pass dataprovider index to item renderer

I have an Advanced datagrid that uses a button as an Item renderer in one column and displays a date in the other. When clicked the button need to remove the date in its row from the ArrayCollection that is the data provider.
The problem is how to tell which index that item is in the ArrayCollection. I know there is an easy way to reference it I just can't find it.

When I drill down trough event.CurrentTarget.data I can get the date column data but I really need the index it is in for the ArrayCollection.
Thanks
dg.png
0
mhopkins9901
Asked:
mhopkins9901
1 Solution
 
Fuzzy_Logic_Commented:
would this be what you are after?
yourArrayCollection.getItemIndex(yourDataGrid.selectedItem)

Open in new window

0
 
zzynxSoftware engineerCommented:
Fuzzy_Logic_ is right.

>> When clicked the button need to remove the date in its row from the ArrayCollection that is the data provider

var index:int = yourArrayCollection.getItemIndex(yourDatagrid.selectedItem);
if (index>-1)
   yourArrayCollection.remove(index);
0

Featured Post

Choose an Exciting Career in Cybersecurity

Help prevent cyber-threats and provide solutions to safeguard our global digital economy. Earn your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now