What IS your dataProvider?

 

You mention "flat array".  How are you getting a tree out of a flat
array?

 

childIndex() is for XML.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Adrian Williams
Sent: Monday, August 18, 2008 12:15 PM
To: [email protected]
Subject: Re: [flexcoders] Re: Identifying row index relative to node vs.
ADG - childIndex() fails.

 

Hi Amy,

    I've tried your suggestion and am having a problem...

    The childIndex() method is not available to my object...and I have
tried it both with my drag event as well as my ADG with negative results
(errors).  

    Here is the function that this lives in:
    
            private function dropHandler(event:DragEvent):void
            {
                var endIndex:int = event.currentTarget.selectedIndex;
                alert.info("Index is:" + endIndex);             
            .
            .
            .

    When I replace 
        var endIndex:int = event.currentTarget.selectedIndex;
    
    with
       var endIndex:int = event.currentTarget.selectedItem.childIndex();

    I get --> TypeError: Error #1010: A term is undefined and has no
properties.

    When I try accessing the actual ADG to attempt to get the position
       
                var endIndex:int =
currentSubgroups.selectedItem.childIndex();

    I get the very same error.  

    Additionally, I've also tried:

                var endIndex:int =
currentSubgroups.dataProvider.selectedItem.childIndex();

    which gets me --> ReferenceError: Error #1069: Property selectedItem
not found on mx.collections.HierarchicalCollectionView and there is no
default value.

    From what little I have been able to find on the net for
documentation on the childIndex() method, it all seems to be using an
XML data set.  Is that part of the problem here...that I am not using an
XML dataset or am I mis-applying this method?

Thanks,
Adrian
    

Amy wrote: 

        --- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , Adrian Williams <[EMAIL PROTECTED]> 
        wrote:
        >
        > Hi all,
        > 
        > I have a challenge....
        > 
        > I am using an ADG in tree mode on a flat array. Everything 
        looks 
        > great. One of the requirements is that whenever a user wants
to 
        > rearrange the order of the rows under a node, I have to store
that 
        index 
        > value (display order). I.E. The 1st node of the ADG is
collapsed. 
        The 
        > 2nd node is expanded. The 5th row in the 2nd node gets dragged
and 
        > dropped to the 3rd row of the same node. The 3rd row then
becomes 
        the 
        > 4th and the 4th then becomes the 5th. The actual drag and drop

        functions 
        > work beautifully. The problem comes into play when I try to 
        identify 
        > the begin index and the end index for the row that was
manipulated.
        > 
        > When I use:
        > 
        > var beginIndex:int = event.currentTarget.selectedIndex;
        
        selectedItem.childIndex();
        
        HTH;
        
        Amy

 

Reply via email to