tags:

views:

65

answers:

1

Hey Guys,

i have a Problem to send a value from the DataGrid to a function- this is my function:

private function browseLoc( location:String ):void { Alert.show(location,'Information'); }

Now i have my DataGrid which receives Information from an XML File. Everything works fine. All Information is shown correctly with that Tags:

<mx:Image x="10" y="346" width="157" height="107" scaleContent="true" source="{codeworxx.pages.page[selectedPageIndex].preview}"/>
<mx:Label x="10" y="492" width="157" fontWeight="bold" text="{codeworxx.pages.page[selectedPageIndex].visible}"/>
<mx:Text x="10" y="513" width="157" text="{codeworxx.pages.page[selectedPageIndex].description}"/>
<mx:Button x="10" y="461" label="Visit Website" width="159" click="browseLoc('{codeworxx.pages.page[selectedPageIndex].url}')"/>

except the Button. The Function "browseLoc" only has the text {codeworxx.pages.page[selectedPageIndex].url} in it - not the value. How do i do it?

Hope you can help!

Thanks, Sascha

A: 

Not very clear from the question.You can use itemClick property on the datagrid component to read the value of the URL on the selected component in the grid.On itemClick you can invoke the browseLoc method.

Rajat