Mh my Dataprovider is an ArrayCollctionboth, but methods do not work.
I still have the same effect.

--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> You might also try using callLater to set the index, to give the DG time
> to re-render.
> 
> Tracy
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Muzak
> Sent: Saturday, December 22, 2007 11:13 AM
> To: [email protected]
> Subject: Re: [flexcoders] Select next DataGrid item after one removed
> 
> Disable the dataprovider from dispatching events before manipulating it
> and enable it again afterwards.
> Assuming you're using an ArrayCollection as dataProvider, the following
> works:
> 
> var index:int = dg.selectedIndex;
> ac.disableAutoUpdate();
> ac.removeItemAt(index);
> dg.selectedIndex = index;
> ac.enableAutoUpdate();
> 
> regards,
> Muzak
> 
> ----- Original Message ----- 
> From: "m.frigge" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Saturday, December 22, 2007 4:40 PM
> Subject: [flexcoders] Select next DataGrid item after one removed
> 
> 
> Hey there,
> 
> I hava a DataGrid and when I click a Delete Button, the selected item
> gets removed (obviously). But then I want the next item to be selected,
> so that you can keep on  pressing Delete and remove one item after the
> other.. as it is in Yahoo mail.
> 
> So I tried something like this:
> 
> oldIndex = grid.selectedIndex;
> removeItem(grid.selectedIndex) // functioin that removes item from
> arrayCollection
> grid.selectedIndex = oldIndex;
> 
> => but then it always selects one after the one I want to be selected.
> 
> So I tried something like this:
> 
> oldIndex = grid.selectedIndex;
> removeItem(grid.selectedIndex) // functioin that removes item from
> arrayCollection
> grid.selectedIndex = oldIndex -1;
> 
> => but then it always selects one before the one I want to be selected.
> 
> Strange.. isnt it?
> 
> Any ideas why this is happening..
> 
> Cheers, Max
> 
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links
>


Reply via email to