![]() |
![]() |
||||||
|
|||||||
| Tags: addeventlistener, spry |
![]() |
|
|||
|
How can I display all the items when selecting a category (menu)?
At the moment is showing only the first item from the dsData set. in the <div spry:detailregion="dsData"> when selecting from <div spry:region="dsCategory">{category}</div>. My goal is to display all the items by category when I click on the <div spry:region="dsCategory">{category}</div> // I have a product xml file. <items> <item type="math"> <category>Math</category> <subject>Division</subject> <grade type="math">Grade 6 - 8</grade> <image>images/math_icon.png</image> </item> <item type="math"> <category>Math</category> <subject>Multiplication</subject> <grade type="math">Grade 4</grade> <image>images/math_icon.png</image> </item> <item type="math"> <category>Math</category> <subject>Addition</subject> <grade type="math">Grade 3</grade> <image>images/math_icon.png</image> </item> <item type="science"> <category>Science</category> <subject>Life Science</subject> <grade type="science">Grade 6 - 8</grade> <image>images/science_icon.png</image> </item> ... </items> <script type="text/javascript"> // I used this to get tall the data: var dsData = new Spry.Data.XMLDataSet("included/products.xml", "items/item"); // I used this to get the categories: // Used distinct category var dsCategory = new Spry.Data.XMLDataSet("included/products.xml","item s/item/category",{distinctOnLo ad: true, distinctFieldsOnLoad:['category']}); </script> // Display the categories: // Using onClick event to set the current row <div spry:region="dsCategory"> <ul id="MenuBar1" class="MenuBarVertical"> <li id="selecteCat" onclick="dsData.setCurrentRow('{ds_RowID}');" spry:repeat="dsCategory"><span>{category}</span></ li> </ul> </div> // Display the selected items base on the category selection: <div spry:detailregion="dsData"> {category} {subject} {grade} <img src="{image}" border="0" /> </div> Do I need to create and Event Listener to do this? Or there is any other way to pass the value onClick event to the data and display it by category??? ~Cheers |
| Sponsored Links |
|
|||
|
miarte wrote:
> Do I need to create and Event Listener to do this? > Or there is any other way to pass the value onClick event to the data and > display it by category??? Try asking your question in the Spry forum where you'll get a more focused group of viewers for your question : http://www.adobe.com/cfusion/webforu...d=72&catid=602 -- Danilo Celic | http://blog.extensioneering.com/ | WebAssist Extensioneer | Adobe Community Expert |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise