millejos
02-02-2007, 08:26 AM
I've searched the forums fairly thoroughly and haven't found the answer yet so I'm posting this question: How do I retrieve row data from within a grid using $path{}? Here's an example of what I mean:
<dataset name="data">
<VenueList>
<Venue Id="1" Name="Fred" Link="http://www.google.com" />
<Venue Id="2" Name="Bob" Link="http://www.yahoo.com" />
</VenueList>
</dataset>
<grid name="chart" datapath="data:/VenueList">
<!-- column 1 -->
<gridcolumn width="${parent.width * 0.10}" clip="true">Id
<attribute name="link" type="string" value="$path{'@Link'}"/>
<text datapath="@Id">
<handler name="onclick">
Debug.write(parent.link);
</handler>
</text>
</gridcolumn>
<!-- column 2 -->
<gridcolumn width="${parent.width * 0.10}" clip="true">Name
<datapointer name="link" datapath="@Link"/>
<text datapath="@Name">
<handler name="onclick">
Debug.write(parent.link);
</handler>
</text>
</gridcolumn>
</grid>
I've tried using both an <attribute> with $path{} and a <datapointer> tag with datapath pointing to the row attribute I want with no luck. The text tag of course has no issues getting the value. I guess I could use a hidden text tag to store that value for the row but... :( Can anyone show me what I'm doing wrong?
<dataset name="data">
<VenueList>
<Venue Id="1" Name="Fred" Link="http://www.google.com" />
<Venue Id="2" Name="Bob" Link="http://www.yahoo.com" />
</VenueList>
</dataset>
<grid name="chart" datapath="data:/VenueList">
<!-- column 1 -->
<gridcolumn width="${parent.width * 0.10}" clip="true">Id
<attribute name="link" type="string" value="$path{'@Link'}"/>
<text datapath="@Id">
<handler name="onclick">
Debug.write(parent.link);
</handler>
</text>
</gridcolumn>
<!-- column 2 -->
<gridcolumn width="${parent.width * 0.10}" clip="true">Name
<datapointer name="link" datapath="@Link"/>
<text datapath="@Name">
<handler name="onclick">
Debug.write(parent.link);
</handler>
</text>
</gridcolumn>
</grid>
I've tried using both an <attribute> with $path{} and a <datapointer> tag with datapath pointing to the row attribute I want with no luck. The text tag of course has no issues getting the value. I guess I could use a hidden text tag to store that value for the row but... :( Can anyone show me what I'm doing wrong?