[flexcoders] How to get selectedIndex from itemRenderer
Hey, I've got a DataGrid that's using an inline itemRenderer of a ComboBox for one of the DataGridColumns. How can I get the selectedIndex of that ComboBox? There's a default sort on the DataGrid and the DataGrid is user-sortable as well, so the selectedIndex isn't going to mirror the index of the selected row in the DataGrid. I need it to pass to a ComboBox in a popup that will appear when the user double clicks it. -- Howard Fore, [EMAIL PROTECTED] The universe tends toward maximum irony. Don't push it. - Jeff Atwood
RE: [flexcoders] How to get selectedIndex from itemRenderer
Are you looking for the index of the DataGrid dataProvider item? If your dataProvider is a collection, you can use Collection.getItemIndex(item). If XML, you can use node.childIndex(). Of course both of those require that you have the needed references available in your renderer. ComboBox implements IdropInListItemRenderer(something like that) so has access to listData, thus the dataProvider. Or I suppose you could use outerDocument to get to the dataProvider. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Howard Fore Sent: Friday, August 29, 2008 10:24 AM To: Flexcoders Subject: [flexcoders] How to get selectedIndex from itemRenderer Hey, I've got a DataGrid that's using an inline itemRenderer of a ComboBox for one of the DataGridColumns. How can I get the selectedIndex of that ComboBox? There's a default sort on the DataGrid and the DataGrid is user-sortable as well, so the selectedIndex isn't going to mirror the index of the selected row in the DataGrid. I need it to pass to a ComboBox in a popup that will appear when the user double clicks it. -- Howard Fore, [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] The universe tends toward maximum irony. Don't push it. - Jeff Atwood
Re: [flexcoders] How to get selectedIndex from itemRenderer
You probably want to get the selectedItem and then look for it in your data provider using indexOf, getItemIndex,.. - Ivo - Original Message From: Howard Fore [EMAIL PROTECTED] To: Flexcoders flexcoders@yahoogroups.com Sent: Friday, August 29, 2008 7:24:29 AM Subject: [flexcoders] How to get selectedIndex from itemRenderer Hey, I've got a DataGrid that's using an inline itemRenderer of a ComboBox for one of the DataGridColumns. How can I get the selectedIndex of that ComboBox? There's a default sort on the DataGrid and the DataGrid is user-sortable as well, so the selectedIndex isn't going to mirror the index of the selected row in the DataGrid. I need it to pass to a ComboBox in a popup that will appear when the user double clicks it. -- Howard Fore, howard.fore@ hofo.com The universe tends toward maximum irony. Don't push it. - Jeff Atwood