Adobe Dreamweaver Forums



Last 10 THreads :         DW help urgently needed, lost my connection to site (Last Post : Ronnie MacGregor - Replies : 11 - Views : 12 )           »          Connecting to a Database (Last Post : Ronnie MacGregor - Replies : 11 - Views : 12 )           »          application.cfm/webservice (Last Post : BKBK - Replies : 1 - Views : 2 )           »          Random positions for Movieclips (Last Post : arnhemcs - Replies : 4 - Views : 8 )           »          Generating LEGAL size Word doc (Last Post : BKBK - Replies : 2 - Views : 3 )           »          This Tough Economy and Flex/AIR (Last Post : LuigiL - Replies : 2 - Views : 108 )           »          Fireworks images seem jaggy or kind of blurry (Last Post : azmatswabi - Replies : 5 - Views : 7 )           »          a group for eve players to discouss the interest (Last Post : evemaven - Replies : 0 - Views : 1 )           »          Trouble using variables to name and instantiateTextFields (Last Post : jc_2006 - Replies : 1 - Views : 2 )           »          Background color code is not working. Please help (Last Post : Tim G - Replies : 9 - Views : 10 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Extensions
 
Tags: ,



Reply
  #1 (permalink)  
Old 08-06-2008, 08:13 PM
miarte
 
Posts: n/a
Diggs:
Default How to spry addEventListener?

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



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-09-2008, 03:21 AM
danilocelic AdobeCommunityExpert
 
Posts: n/a
Diggs:
Default Re: How to spry addEventListener?

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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 11:53 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk