Did I forget a bet we had? I'm drawing a blank on this but maybe I've
had too much turkey in the last week...

Could you please file a bug that all the displaced children should
dispatch a childIndexChanged event?

- Gordon


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of JesterXL
Sent: Wednesday, December 28, 2005 9:42 AM
To: Flexcoders
Subject: [flexcoders] Gordon Smith owes me $10 (i.e. setChildIndex)

In mx.core.View, setChildIndex generates a childIndexChanged event. 
However, 2 children are affected by the index changing; the child that
is 
moved, and the child that is displaced.  I haven't tested this in Flex 2

yet, but in Flex 1.5, the event should either be changed, or 2 events
should 
be generated.

My fix is:

// moving up
var index:Number = getChildIndex(lastClicked);
var displacedChild:EditableElement = EditableElement(getChildAt(index -
1));
// remove it & move it
var tmpID:Number = __dataProvider.getItemID(index);
__dataProvider.splice(index, 1);
item.__ID__ = tmpID;
__dataProvider.splice(index - 1, 0, item);
var dOldIndex:Number = getChildIndex(displacedChild);
setChildIndex(lastClicked, index - 1);
var dNewIndex:Number = getChildIndex(displacedChild);
dispatchEvent({type: "childIndexChanged", relatedNode: displacedChild,
prevValue: dOldIndex, newValue: dNewIndex}); 




--
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



 




--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to