Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to pass dataprovider index to item renderer

Posted on 2009-04-09
2
Medium Priority
?
1,871 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
Fuzzy_Logic_ earned 2000 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

Eye-catchers on the conference table

Challenge: The i-unit group was not satisfied with the audio quality during remote meetings. They were looking for a portable solution with excellent audio quality for use in their conference room but also at their client’s offices.

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…
Read on to get a few ideas on how to promote your next corporate event.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

722 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