Solved

how to pass dataprovider index to item renderer

Posted on 2009-04-09
2
1,840 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
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…

863 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

26 Experts available now in Live!

Get 1:1 Help Now