Using Dreamweaver, I am looking to find out how to link a
spry repeat list (Select Drop-Down) to a Spry table.
I have created a repeat list (Select Drop-Down) using a
distinct filter on a field in my XML data base :
The XML database is:
var ds2 = new
Spry.Data.XMLDataSet("Data/NetballDatafeed190401.xml",
"NetballList/NetballProducts/SubType",{sortOnLoad:"SubType",sortOrderOnLoad:"as
cending",distinctOnLoad:true});
The drop down list is created by
<div spry:region="ds2">
<select name="select" spry:repeatchildren="ds2">
<option value="{SubType}">{SubType}</option>
</select>
</div>
I have a table which I want to show only the values on the
table where the subType that matches the value from the select
list.
This data is populated by:
var ds1 = new
Spry.Data.XMLDataSet("Data/NetballDatafeed190401.xml",
"NetballList/NetballProducts",{sortOnLoad:"ProductPrice",sortOr
derOnLoad:"ascending"});
and is created by
div spry:region="ds1">
<table>
<tr>
<th>ProductName</th>
<th>ProductPrice</th>
<th>ImageURL</th>
<th>SubType</th>
</tr>
<tr spry:repeat="ds1">
<td>{ProductName}</td>
<td>{ProductPrice}</td>
<td><img src="{ImageURL}"/></td>
<td>{SubType}</td>
</tr>
</table>
</div>
I believe that I need to create a spry:Choose statement in
the drop down list which runs a function that filters the DS1 XML
data.
I beleive that The function need to look like
var myFilterFunc = function(dataSet, row, rowNumber)
{
some funtion here that filters ds1 on {SubType}.......
}
I will then need to run ds1.filter(myFilterFunc);
Any pointers or examples most welcome.