Solved

how to pass dataprovider index to item renderer

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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

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…
This article is written by John Gates, CISSP. Gates, the SNUG President-Elect, currently holds the position of Manager of Information Systems at Lake Park High School in Roselle, Illinois.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses

617 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