Hi Tracy, This is mainly an architectural issue. The entire code base is based on events dispatching and listening.
I know your suggestion is valid, but that's not the one I'm trying to achieve. Best regards, On Mon, Sep 15, 2008 at 6:52 PM, Tracy Spratt <[EMAIL PROTECTED]> wrote: > Instead of trying to simulate an itemClick, why not put all of the change > event actions into a separate function, and call that from both the change > handler and from the programattic selection function? > > Tracy > > > > ________________________________ > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Guilherme Blanco > Sent: Monday, September 15, 2008 4:30 PM > To: [email protected] > Subject: [flexcoders] Dispatching AdvancedDataGrid change event by hand > > > > Hi all, > > I'm implementing an automate way to select items by passing the id of > rows. The idea is to simple do: > > <root> > <item id="1" ..../> > </root> > > this.selectedId = 1; > > And it'll select the item that has id = 1. > > I get everything working as expected, except of events triggering. > > When I do a simple this.selectedIndex = i; > If changes the selected row as I want to, but does not trigger the change > event. > > So I need to manually trigger this event (since I have actions related > to this event). > How to I manually call this event? > > I did this for a ComboBox, which had the same issue too... I did that by > doing: > > this.dispatchEvent(new ListEvent.CHANGE, false, false, 0, i)); > > But now the component is AdvancedDataGrid. By answering the first > question, I also want to ask about how do I do the same event for > multiple rows selection (when allowMultipleSelection = true). > > Thanks in advance, > > Best regards, > > -- > Guilherme Blanco - Web Developer > CBC - Certified Bindows Consultant > Cell Phone: +55 (16) 9166-6902 > MSN: [EMAIL PROTECTED] > URL: http://blog.bisna.com > Rio de Janeiro - RJ/Brazil > > -- Guilherme Blanco - Web Developer CBC - Certified Bindows Consultant Cell Phone: +55 (16) 9166-6902 MSN: [EMAIL PROTECTED] URL: http://blog.bisna.com Rio de Janeiro - RJ/Brazil

