I am using Flex Builder 3 and all this is extremely new to me.
I have it reaching out to my mySQL database and displaying 4 of the columns in it (which is what I asked it to do). However, I want to have the results of the "prod_title" column display as a link to the product page. The url to that page is held in the "prod_url" column. My current Flex code looks like this.
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="doSend()"
layout="absolute"
backgroundColor="#FFFFFF"
maxWidth="710"
maxHeight="710"
width="710"
height="710"
borderThickness="1">
<mx:TitleWindow
height="60"
layout="absolute"
title="Complete Animal Index"
fontSize="36"
color="#000000"
horizontalAlign="center"
id="title"
verticalAlign="top"
showCloseButton="false"
themeColor="#FFFFFF"
width="500"
horizontalCenter="12"
top="2"
fontFamily="Verdana"
textDecoration="normal"
fontWeight="bold"
backgroundColor="#FFA800">
</mx:TitleWindow>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var datalist:ArrayCollection;
private function resultHandler(event:ResultEvent):void{
datalist = event.result.data.row;
}
public function doSend():void {
xmlFromDatabase.url = "http://www.animalmakers.com/Testing/dbConnect.php";
xmlFromDatabase.send();
}
]]>
</mx:Script>
<mx:HTTPService url="http://www.animalmakers.com/Testing/dbConnect.php"
id="xmlFromDatabase"
showBusyCursor="true"
result="resultHandler(event)"
method="GET" />
<mx:DataGrid x="1" y="72" dataProvider="{datalist}" id="dg" width="700" height="618">
<mx:columns>
<mx:DataGridColumn headerText="Stock No" width="65" dataField="stock_no"/>
<mx:DataGridColumn headerText="Product" width="335" dataField="prod_title"/> // I WANT TO ADD THE LINK HERE
<mx:DataGridColumn headerText="Category" width="150" dataField="category_1"/>
<mx:DataGridColumn headerText="Sub-Category" width="150" dataField="sub_cat"/>
</mx:columns>
</mx:DataGrid>
</mx:Application>
Ideas?