scorptique
05-31-2009, 01:00 AM
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
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);
}
--------------------------------------------------------------------------------
<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>
-------------------------------------------------------------------
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
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);
}
--------------------------------------------------------------------------------
<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>