Usin Spry$$ in spry:repeat regions
Hi,
I'm not sure whats happening here but i'll try to be
detailed.
I am using spry to make a master page set.
on a region i have
quote:
var observer = { onPostUpdate: function(notifier, data) { var
r = Spry.$$(".changeStatusLink").addEventListener("click",
changeStatus, true); } };
where the element selector is
quote:
<td align="center" valign="middle" nowrap="nowrap"
spry:setrow="ds1 {ds_rowID}">[EDIT] | [<a
id="statusLink{ds_RowID}" class="changeStatusLink">CHANGE
STATUS</a>] | [DELETE]</td>
in a
spry:repeat region
Now on a "click" the selector is able to trigger the
changeStatus function....but for some reason
only the first row's {ds_RowID} of the
spry:repeat is being captured when the function
"changeStatus"
is
quote:
function changeStatus(e){
var row = ds1.getCurrentRow();
var id = row['@id'];
alert(id);
is it the fact that because the "class" is being repeated it
is not picking up the actual "element" that triggered the event? or
is there something wrong with the ds1.getCurrentRow?Text
the spry:repeat IS on the
<tr>
I don't have a URL
but the code is...
quote:
<!--
var ds1 = new Spry.Data.XMLDataSet("get_docs.php",
"documents/doc",{sortOnLoad:"@section",sortOrderOnLoad:"ascending",useCache:false});
ds1.setColumnType("@id", "number");
function MySuccessCallback(req)
var state = req.xhRequest.responseText;
if(state == 1){
ds1.setDataFromArray([req.userData]);
}else if(state == 2){
}else{
function MyErrorCallback(req)
// Throw an alert with the message that was
// passed to us via the userData.
alert("ERROR: " + req.userData.msg);
function changeStatus(e){
alert(e.target);
var row = ds1.getCurrentRow();
var id = row['@id'];
alert(id);
var req = Spry.Utils.loadURL("POST", "set_status.php", true,
MySuccessCallback, { postData: "docid="+id+"&action=status",
headers: { "Content-Type": "application/x-www-form-urlencoded;
charset=UTF-8" }, errorCallback: MyErrorCallback, userData: row })
var observer = { onPostUpdate: function(notifier, data) { var
r = Spry.$$(".changeStatusLink").addEventListener("click",
changeStatus, true); } };
Spry.Data.Region.addObserver("documentList", observer);
Spry.Utils.addEventListener(Spry.$$(".changeStatusLink"),"click",changeStatus,true);
//-->
Similar Messages
-
Help with Spry Rating Widget within a Spry Repeating Region
My link http://www.youthinkyougotitbad.com
This is a long question, but it seems to me if answered somewhere it could help alot of people in the spry community creating comment boards as it uses three important spry widgets: rating, repeating, and tabbed panels. I am trying to use spry rating widget within a spry repeating region within a spry tabbed panel with xml. I was trying to go with the pulse light script (http://forums.adobe.com/message/3831721#3831721) but Gramps told me about the spry rating widget. But I have ran into a couple more problems. First, I couldnt find that much information on the forums or online about how to do the php page with the spry rating widget. None of these have any information on how to do it:
http://labs.adobe.com/technologies/spry/articles/rating_overview/index .html
http://labs.adobe.com/technologies/spry/articles/data_api/apis/rating. html
http://labs.adobe.com/technologies/spry/samples/rating/RatingSample.ht ml
And it seems that the official examples are so poor (or I am just ignorant, which def could be a possiblity) it shows
to set the initial rating value from the server, but uses a static value of 4
http://labs.adobe.com/technologies/spry/samples/rating/RatingSample.html
<span id="initialValue_dynamic" class="ratingContainer">
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<input id="spryrating1_val" type="text" name="spryrating1" value="4" readonly="readonly" />
<span class="ratingRatedMsg sample">Thanks for your rating!</span>
</span>
<script>
var initialValue_dynamic = new Spry.Widget.Rating("initialValue_dynamic", {ratingValueElement:'spryrating1_val'});
</script>
I finally found a site that has the php and mysql setup.
http://www.pixelplant.ro/en/articles/article-detail/article/adobe-widgets-for-download.htm l
But its not perfect. It has the same problem that I ran into with Pulse light, that you had to use php echo within the spry repeating region to set the initial value from the server:
<span id="spryrating1" class="ratingContainer">
<span class="ratingButton"></span>
<input type="text" id="ratingValue" name="dynamic_rate" value="<?php echo $row['average']?>"/>
</span>
<script type="text/javascript"
var rating1 = new Spry.Widget.Rating("spryrating1", {ratingValueElement:'ratingValue', afterRating:'serverValue', saveUrl: 'save.php?id=spryrating1&val=@@ratingValue@@'});
</script>
So instead, I tried with three of my panels (www.youthinkyougotitbad.com) to get the average rating from xml by using the following queries:
Recent
Returns the blurts in most recent order along with average rating
SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt Group By Id_blurt ORDER BY Blurt.`Date` DESC
Wet Eyed
Returns the blurts in highest ratings order along with the average rating
SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt, DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt AND ratings.rating_value > 0.1 Group By Id_blurt ORDER BY average_r Desc
Dry Eyed
Returns the blurts in lowest rating order along with the average rating
SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt, DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt AND ratings.rating_value > 0.1 Group By Id_blurt ORDER BY average_r
These all return the correct xml in the correct order.And they return the average rating of each blurt which I can send to my page with xml.
My first question is that I dont know how to configure the query on my fourth panel Empathized & Advised the same way because it already has a Group By for the Comment Id.
SELECT `Comment`.id_Blurt, COUNT(*) as frequency, Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt, DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date FROM Blurt, `Comment` WHERE Blurt.Id_blurt = `Comment`.id_Blurt GROUP BY `Comment`.id_Blurt ORDER BY COUNT(*) DESC";
Not sure if you guys need more information to understand that all, if so just ask.
So after I get my average value through xml to the first three panels, I set my spry repeating region up like this:
(Blurt panel)
<div spry:region="pv1" spry:repeatchildren="pv1">
<div class="blurtbox">
<!-- most recent blurt tab-->
<h3> "{pv1::Blurt}"</h3>
<p> Blurted from {pv1::Location} at {pv1::Date}</p>
<p>Empathize or Advise about {pv1::Name}'s Blurt #<a href="detailblurt.php?blurtid={pv1::Id_blurt}"> {pv1::Id_blurt}</a></a></p>
<span id="{pv1::Id_blurt}" class="ratingContainer">
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingButton"></span>
<span class="ratingRatedMsg">Thank You! Your tears have been tallied.</span>
<input type="text" id="ratingValue" name="dynamic_rate" value="{pv1::average_r}"/>
</span>
<script type="text/javascript">
// overview of available options and their values:
// http://labs.adobe.com/technologies/spry/articles/rating_overview/index.html
var rating1 = new Spry.Widget.Rating("{pv1::Id_blurt}", {ratingValueElement:'ratingValue', afterRating:'serverValue', saveUrl: 'save.php?id={pv1::Id_blurt}&val=@@ratingValue@@'});
</script>
<br/>
</div>
</div>
Ok, it registers the right vote in the database with the right blurt id each time. But I am having two problems so far:
One, even though {pv1::average_r} returns the correct average through xml, it doesn't show the initial rating value for each of the repeating blurts. It seems to show the first one correct, and then just repeat that same value to the other ones that follow. I just dont understand since it can get the correct server value right after you vote (afterRating:'serverValue), that I can't manipulate spryrating.js in some way that I could just replace 'ratingValue' in ratingValueElement:'ratingValue' with something to give me the initial server value.
Two: Is even more mysterious to me, if you play around with voting on the site, sometimes you are unable to vote on different blurts. Its weird. It seems like that the javascript is completely off just on those blurts. And sometimes its a whole row, sometimes none. But so far its never a problem on the first tabbed panel (Recent), only on the other three. As far as I know, the coding is exactly the same in each tab's repeating region except for the different xml input.
And, now on the live server, sometimes the pics of tears used to voting dont show up until you click.
Any help on those three questions (how to query the fourth panel, how to show the initial server value, and the glitches with voting) would be greatly appreciated!! I looked pretty hard on adobe forums and other sites, and didnt see much on how to really use the spry rating widget with php and xml.
Thanks!!Update:
Ok, the first query on the Recent tab doesnt work for me because it wont show unless its already voted, and since these are supposed to be new blurts, that kind of breaks the whole site:
"SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date, ratings.rating_id, Avg(ratings.rating_value) as average_r FROM ratings Left Join Blurt On ratings.rating_id = Blurt.Id_blurt Group By Id_blurt ORDER BY Blurt.`Date` DESC";
So I replaced it with what I originally had.
"SELECT Blurt.Id_blurt, Blurt.Name, Blurt.Location, Blurt.Blurt,Blurt.`Date`,DATE_FORMAT(Blurt.`Date`, '%l:%i %p on %M %D, %Y') as Date FROM Blurt ORDER BY Blurt.`Date` DESC";
But this doesn't provide me with the initial average rating:( -
Hello everyone,
I've recently started using Spry for a project I've been
asked to work on and I've run in to a few issues since my spec
changed on me today. So any help or advice anyone has is very much
welcome as I'm very much out my comfort zone at the moment.
Original Spec
The idea originally was to have a drop down of roles which
was created from the role tag within a xml file which I was able to
do as you can see below in the attached code. Once the user had
picked a role it would then
ds2.setCurrentRowNumber(this.selectedIndex) and this would trigger
the spry detail region I have to populate the fields I setup to get
out of the xml the role, process and info.
At the time I was told a role would only appear once in the
file but this is now not the case :(
My problem / New Spec
Unfortunately with the xml now having a role more then once
I've been asked to include a dynamic region which will display the
process and info fields from other records which have this role
name. Which is the bit I'm having problems with. I've been playing
with creating a spry:repeat for each field and then using
Spry:if="'{Role}'.search(^/myVar/) != -1; but I've had no luck
getting a value into a variable and I'm lack of experience is
running out of ideas.
Hope I've made sense this is my first time using spry and
JavaScript, so any help is greatly welcome.
Thanks Nick.
Example of the XML file - Please note this is very much a cut
down version.tried changing the Region HTML table cell attributes to width:75pct, but this has no effect.Unsurprisingly. Use a valid CSS length specification.
-
Limiting Number of Rows in spry:repeat Region
With the code...
<tr spry:repeat="dsTitles">
<td width="60%">{title}</td>
<td width="14%">{author}</td>
<td width="9%">{date}</td>
</tr>
... How do I limit the number of rows that will be displayed
in this repeat region
to just 5, instead of displaying all 25 rows stored in the
XMLDataSet (dsTitles)?
Thanks!
OscarHey Oscar,
Glad that works for you.
Kin and I were thinking that {ds_RowNumber} might be better
for that particular looping, but you get the idea.
http://labs.adobe.com/technologies/spry/articles/data_set_overview/index.html
That was our first overview doc and it was definitive at the
time. We no longer update it but it's a good intro to Spry.
You can find the built in data references in that doc,
granted almost at the very bottom.
The API doc
http://labs.adobe.com/technologies/spry/articles/data_api/index.html
is a good start but we still have a lot to add to it. I have
plans for it for sure.
We are doing a big push for 1.6 towards progressive
enhancement, unobtrusive js and things like that.
Expect docs and samples and some cool utilities to come out
this summer and for 1.6.
And we won't charge for it, but we also won't return any
cash-laden envelopes... ;)
Let us know how to improve any part of Spry.
Thanks,
Don -
Is it possible to restrict repeat regions in Spry to ie. 5 or
10 records per page. I am sure we could do this before on ASP
pages.Yes this is possible, Spry has a special class for that
called: SpryPagedView
http://labs.adobe.com/technologies/spry/samples/data_region/SpryPagedViewSample.html
^ sample -
Improving Efficiency of Spry Repeat Region
Hi,
I'm using the haversine formula (to calculate distance
between two points on a sphere). Ultimately I'm using the output to
limit the number of results displayed per the code below. My
question is why I have to run OPTION 1 instead of just running the
code in OPTION 2...
Thanks.OK one more question. I have this code in a spry:repeat="ds1"
region:
if (ds1.getDataWasLoaded()) {
alert('{ds1::ds_RowNumber}');
Why does the first alert literally say "{ds1::ds_RowNumber}"
before it proceeds to give me the expected "0", "1", etc .. ? I
thought checking for ds1.getDataWasLoaded() would avoid this.
Best,
Dylan Oliver -
I am creating a staff page for our school using Dreamweaver
CS3. I can create a spry region and a repeat region and the staff
image and its caption get displayed but he repeat ocuurs in a
stacked format. Is there any way to configure the repeat to occur
like a table (so many columns and rows concept). Thanks.
Darren<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="50%"><div spry:region="{ds1}">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td spry:repeat="ds1">{thumbnails}</td>
</tr>
</table></div></td>
<td><div spry:detailregion="ds1">{Detail
Region}</div></td>
</tr>
</table>
I'm not sure how this would work for alot of thumbnails, but
it works for what I used it for (4 thumbnails across the
row) -
Work around for spry:repeat="ds1 ds2" limitation
I need to have both data sets repeat when using a Spry repeating region:
<div id="apDiv4" spry:region="ds1 ds2">
<table class="sprytable" border="1">
<tr>
<th spry:sort="Q#">Q#</th>
<th spry:sort="Category">Category</th>
<th spry:sort="Question">Question</th>
<th spry:sort="You">You</th>
</tr>
<tr spry:repeat="ds1 ds2">
<td>{ds1::Q#}</td>
<td>{ds1::Category}</td>
<td>{ds1::Question}</td>
<td>{ds2::You}</td>
</tr>
</table>
</div>
If I use ds1 in the spry:repeat, ds1 data will repeat (but ds2 will use the first value); or if I specify ds2, ds1 will use the first value.
I need them both to repeat.
I have spent so much time in forums, etc. and can't seem to find a workaround.
My only work around is to combine ds1 and ds2 and reload them together from the server - yuk!
ds1 is fixed and large. ds2 is small and dynamic so reloading really sucks.
Following are the ds Vars - probably irrelevent:
var ds1 = new Spry.Data.HTMLDataSet(null, "rsfamily", {sortOnLoad: "Q#", sortOrderOnLoad: "ascending" }); ds1.setColumnType("Q#", "number"); var ds2 = new Spry.Data.HTMLDataSet("youranswersIRtab.php", "youranswerstab", {}); I will worship the person who gives me an idea.
ThanksThanks V1, timkho and coolsanwa for your thoughts. Since you've been so patient (and understanding) let me briefly tell you what I'm trying to do.
I'm considered good at multi-dimensional databases and have recently fallen in love with DreamWeaver to build a pretty complex site so I don't have to be a real expert at PHP, Spry, Ajax, JavaScript, DOM, HTML, CSS etc (I suck, but most everything is working).
I wish I could point you to a site but I need to keep it secret for a bit - its strictly on my PC for now.
Let me explain the snippit, which I still don't have working .
ds1 has three columns and ds2 has one.
ds1 ds1 ds1 ds2 ds3
Q# Category Question You Compare1
1 Boats How big? 24 36
2 Boats What color? Blue Red
3 House Number rooms? 3 6
4 House Sq feet? 1000 3000
5 House Have garage? No Yes
etc to 200+
ds1 doesn't change and I don't want to reload it
ds2 are your saved answers (I will have a form to fill in and a Submit- different subject)
ds3 is user selected comparisons, retrieved from a MD database (academic because ds2 has me stopped).
Category has table row classes (to whole row), which will drive Tabbed Panels.
ds1, ds2, ds3 data have the class assigned to each row (setRowSelector) classes for columns(setColumnSelector).
I want a Spry Table with its many neat features (eg. sorting) that combines the 3 ds's (lets worry about 2 for now).
Incredibly simple but I'm stuck.
Timko suggestion results in syntax error- removing single quotes.
Collsanwa suggestion creates new columns so repeat is done for each row after You column:
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
24,Blue,3,1000,No
200+ times
(I'll repeat the snippit) . Could you point me to an explanation for the spry:if id/mmid
Thanks so much.
<div id="apDiv4" spry:region="ds1 ds2">
<table class="sprytable" border="1">
<tr>
<th spry:sort="Q#">Q#</th>
<th spry:sort="Category">Category</th>
<th spry:sort="Question">Question</th>
<th spry:sort="You">You</th>
</tr>
<tr spry:repeat="ds1">
<td>{ds1::Q#}</td>
<td>{ds1::Category}</td>
<td>{ds1::Question}</td>
<td spry:repeat="ds2" spry:if="'{ds1::id}' == '{ds2::mmid}'">{ds2::You}</td>
<!-- <td spry:repeat="ds2" spry:if="{ds1::id} == {ds2::mmid}">{ds2::You}</td> Syntax error w/o quote-->
</tr>
</table>
</div> -
Limiting Items Displayed in Spry Repeat Lists, Tables, Etc.
Is it possible to limit the items shown in Spry repeat
region? For example say I have 20 items in a list and only want to
display the first three items, not the entire list. If so how is
that done?Hey Oscar,
Glad that works for you.
Kin and I were thinking that {ds_RowNumber} might be better
for that particular looping, but you get the idea.
http://labs.adobe.com/technologies/spry/articles/data_set_overview/index.html
That was our first overview doc and it was definitive at the
time. We no longer update it but it's a good intro to Spry.
You can find the built in data references in that doc,
granted almost at the very bottom.
The API doc
http://labs.adobe.com/technologies/spry/articles/data_api/index.html
is a good start but we still have a lot to add to it. I have
plans for it for sure.
We are doing a big push for 1.6 towards progressive
enhancement, unobtrusive js and things like that.
Expect docs and samples and some cool utilities to come out
this summer and for 1.6.
And we won't charge for it, but we also won't return any
cash-laden envelopes... ;)
Let us know how to improve any part of Spry.
Thanks,
Don -
Adding behavior to spry:repeat
Hi all,
I need to hook into the creation of DIVs during data load (using SpryData) to add behavior to the DIV. Is there some built-in hook, or event that is thrown to do this? Or do I need to hack SpryData to do it?
Basically, what I want to do is position each element in a specific space, and then add custom events to each DIV as it is created.
The code I have so far looks like this:
<body>
<div id="mainContainer">
<div id="menuContainer" class="MenuContainer">
<div id="profileMenu" class="ProfileMenu" spry:region="dsIndigoProfileMenu">
<div id="p{ds_RowNumber}" class="ProfileMenuItem" spry:repeat="dsIndigoProfileMenu">
<div class="content">{@label}</div>
</div>
</div>
<div id="mainMenu" class="MainMenu" spry:region="dsIndigoMainMenu">
<div id="m{ds_RowNumber}" class="MainMenuItem" spry:repeat="dsIndigoMainMenu">
<div class="content">{@label}</div>
</div>
</div>
<div id="subMenu" class="SubMenu">
SUB
</div>
</div>
</div>
</body>
For each spry:repeat section, I need to hook in so I can alter the inner DIV (class="content") to layout the information in a specific manner.
Any input greatly appreciated!
Cheers,
ChrisNot sure what you mean by hooks, but if you are speaking of styling content, use CSS. Leave the Spry Data Javascript file intact, or it will act up on you. If your 'chunks' of data are what you want to dive into and style bits of each chunk (all technical terms...), you might need to subdivide your data into smaller chunks. Then, wrapping in divs with classes will give you control over styling.
You already have a cascade of classes and ids in your code that you can use to attach styles to.
If you are talking about adding Javascript behaviors, they are typically "attached" using <a> tags, as you need to have defined elements to attach them to.
But generally speaking, when you use Spry:Repeat regions you can totally style up your first region, including the behaviors, then when 'running' the repeat, all the styling and behavior is copied to the repeats.
Beth -
Spry collapsible panel - repeating region
Hi,
I'm trying to make a repeating region that contains a spry
collapsable panel.
The problem is that i need to develop a way to automatically
increase the ID of the spry panel.
The problem I am encountering is that only the first
Collapsible Panel works properly. The remainder are displaying the
data, but will not open and close when their tabs are clicked. It
appears that all are being repeated as
id="CollapsiblePanel1".
Does anyone have a way to increment the Tab & Content
ID's?
On another forum, somebody has suggested using the following
PHP - although having never used PHP before, I am uncertain as to
where I insert this into my code:bump
-
Need to control page view to 20 from an html data source for a spry data repeating region
</style>
<script src="SpryAssetPan/SpryData.js" type="text/javascript"></script>
<script src="SpryAssetPan/SpryHTMLDataSet.js" type="text/javascript"></script>
<script src="SpryAssetPan/SpryPagedView.js" type=”text/javascript”></script>
<script type="text/javascript">
<!--
var ds1 = new Spry.Data.HTMLDataSet("wrapAround_master2.html", "wrap2", {distinctOnLoad: true, sortOnLoad: "Item", sortOrderOnLoad: "ascending"});
var pv1 = new Spry.Data.PagedView( ds1 ,{pageSize: 20 });
//-->
</script>
</head
<body>
<div id="wrapper">
<div spry:region="ds1">
<div id="repeatOne" spry:repeat="ds1">
<p>{Photo_2}<br />
{Item}</p>
</div>
Here you can find the file that I need to Create Paged View data set navigation
http://www.hohmangraphics.com/masterProductGuide/WrapAround_art/joestest_2.htmlThank you,
With some adjustments it worked, see source code below,
<script src="SpryAssetPan/SpryData.js" type="text/javascript"></script>
<script src="SpryAssetPan/SpryHTMLDataSet.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript" src="SpryAssetPan/SpryPagedView.js"></script>
<script language="JavaScript" type="text/javascript">
var ds1 = new Spry.Data.HTMLDataSet("wrapAround_master2.html", "wrap2", {distinctOnLoad: true, sortOnLoad: "Item", sortOrderOnLoad: "ascending"});
var pv1 = new Spry.Data.PagedView( ds1 ,{pageSize: 10});
//-->
</script>
</head>
<body>
<div id="wrapper">
<p>
<input type="button" value="First" onclick="pv1.firstPage();" />
<input type="button" value="Prev" onclick="pv1.previousPage();" />
<input type="button" value="Next" onclick="pv1.nextPage();" />
<input type="button" value="Last" onclick="pv1.lastPage();" />
<br />
</p>
<div spry:region="pv1 ds1">
<div id="repeatOne" spry:repeat="pv1">
<p>{Photo_2}<br />
{Item}</p>
</div> -
Spry widget / php recordsets / repeatable regions
okay this deals with the spry collapsiblepanel widget in cs3.
I'm testing the ability to create a news feed with this feature
paired with a php recordset. My issue involves the repeated widgets
not working like the first one. I know it probably is a result of
the region thats being repeated / the collapsible panel. Look at
the code and this test site that i've worked up.
test website the
code is below...i've commented out the start and end of the
repeated region.PHP, being a serverside code, will refresh the page each time there is a request made to the server. JavaScript (and Spry), being a client side code, does not have to send requests to the server and therefore allows you to change the data without a page refresh.
Having said that, you need to have a Spry dataset in your Accordion panel.
By following these steps, you will be well on your way to achieving what you want.
Retrieve your data using PHP and place it in an HTML-table or similar outside of the Accordion panel
Create a SpryHTMLDataSet based on the HTML-table
Use the data from the Spry dataset to create a master/detail region in your Accordion panel
Just a few questions before I go into details.
Have you set up a connection to a database, thus be able to retrieve the data?
Why do you need an Accordion panel to show your data?
Have you got an online URL so that we can follow your code? Otherwise please include your code in your post.
Please come back here with your answers and we shall try to help you on your way
Ben -
Dreamweaver - spry rating & repeating regions
Hi,
I'm trying to make a repeating region that contains a spry rating widget (I have downloaded the extension).
The problem is that I need to develop a way to automatically increase the ID of the spry rating.
The problem I am encountering is that only the first spry rating works properly. The remainder are displaying the data, but show only a text field. It appears that all are being repeated as
id="SpryRating1".
Does anyone have a way to increment the spry rating id for each element of the repeating region?
Thanks for yours replies,
Gabriel
PD: I have the same problem with the sustitution images. Does anyone have a solution?This is very easy to do with a server-side language. Create a variable counter, and increase the counter each time the repeat region runs.
-
Spry repeted region: only at filtering
Hi all:
I made a typical spry region with a table and an spry:repeat. Also I included a form with a text field and a button for filter. Everything works fine.
When the user loads the page, all data is shown and that was fine while the XML file has few data. But now I have about 2500 rows and it has no sense to show all the data at first. I'd like that when the user load the page, it shows the page with no data. The data must be shown only when a filter is executed.
I tried with this:
<script type="text/javascript">
var dsMyData = new Spry.Data.XMLDataSet("xml/data.xml ....
dsMyData.filter(null);
and it works but..... it takes some time to process... almost the same if all data were shown. Also I tried moving the dataset's declaration to other parts of the code with no success. Is there a way to make the dataset works only when the user click my search button and not when the page is loaded?
Thanks a lot and sorry my english
PCI tend to use XPath to filter larger datasets. On change of the selected item you can change the value of XPath to show that data range.
Have a look here http://labs.adobe.com/technologies/spry/samples/data_region/XPathFilteringSample.html
Gramps
Maybe you are looking for
-
Problem opening PC files created on latest version of CS5 on Mac
Hi. We´re a creative team in my company of four people, three mac users and one pc user. We recently all subscribed to the creative cloud so that we allways have the latest version of CS5, but there seems to be a problem with all files edited or crea
-
Why am I no longer able to spend money on clash of clans, being told to go to iTunes support
-
I always get an error message in the middle of writing mail if I pause.
When I am writing an email in Mail, and I pause to think, I get an error message. I can click OK, and it will let me go on as I was, but I am unsure as to why this is happening. Please help.
-
hello, i'm prepare a bdc program for F-22, when i record the process through shdb, an error occurs said a field must be filled( but the field is not on the current screen), and when a press enter a popup dialog said i can fill the field in the next
-
Deleting the inventory for deleted material
Hi Can you please guide how to delete inventory for the deleted material? Stock is available in the inventory but the material is deleted. Regards Raja