Solved

how to pass dataprovider index to item renderer

Posted on 2009-04-09
2
1,837 Views
Last Modified: 2012-05-06
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
Comment
Question by:mhopkins9901
2 Comments
 
LVL 5

Accepted Solution

by:
Fuzzy_Logic_ earned 500 total points
ID: 24111093
would this be what you are after?
yourArrayCollection.getItemIndex(yourDataGrid.selectedItem)

Open in new window

0
 
LVL 37

Expert Comment

by:zzynx
ID: 24114442
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
google maps with flash 1 362
[Q] XML to Object/Dictionary class available? 3 698
Adobe upload listbox 2 489
Flex Mobile - update/refresh current view 7 1,232
First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now