Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    extract data from advancedDataGrid. Please help.

    I know http://forums.adobe.com/thread/131416 has the answer inside but i dont understand what it means (hierarchy and cursor thingies) and how to use it. I only manage to understand until the getting selected index, and I got it. But I dont know how to use it to extract the data from that row and trace it out. please help me add on to my doubleClickHandler function. These are my codes.

    -------------------------------------------------------------------
    my xml file.

    <location locations="Singapore">

    <locations Region="north">
    <details l_id="7" l_title="Causeway Point" street="1 Woodlands Square, #01-39 Causeway Point"/>
    <details l_id="17" l_title="IMM Building" street="2 Jurong East Street 21, #01-51"/>
    </locations>

    <locations Region="west">
    <details l_id="4" l_title="Arena Country Club " street="511 Upper Jurong Road, #01-06"/>
    <details l_id="19" l_title="Jurong Point" street=" 63 Jurong West Central 3 #B1-54/55 Jurong Point"/>
    </locations>
    </location>


    --------------------------------------------------------------------------------

    my actionscript code in the main mxml file

    Code:
    private function doubleClickHandler():void
                {  
                    var item:Object = agd.selectedItem;
                    var index:int = agd.selectedIndex;
                   
                    if (!item || index == -1)
                    return ;
                    Alert.show("Double Clicked item index:" + index);            
                }

    --------------------------------------------------------------------------------

    Code:
    <mx:AdvancedDataGrid id="agd"
    doubleClickEnabled="true" itemDoubleClick="doubleClickHandler()">
            <mx:columns>
                <mx:AdvancedDataGridColumn dataField="@locations"
                    headerText="Location"/>
                <mx:AdvancedDataGridColumn dataField="@l_title"
                    headerText="Title"/>
                <mx:AdvancedDataGridColumn dataField="@l_street"
                    headerText="Street"/>
            </mx:columns>
        </mx:AdvancedDataGrid>

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    The "item" variable in the "doubleClickHandler" function should contain the object with the row you double-clicked on. You can trace it out like so:
    Code:
    import mx.utils.ObjectUtil;
    trace(ObjectUtil.toString(item));


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •