• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Spry Repeat List Unique

i have a Spry Repeat List (set up as a drop down list) and i need to show unique values only, does anyone have any idea?
Thanks.
//ds1 is my dataset
//{fldEventCode} is the field that needs to show unique values only  like a 'SELECT DISTINCT' query
  <div spry:region="ds1">
          <select name="select" spry:repeatchildren="ds1">
          <option value="{fldEventCode}">{fldEventCode}</option>
          </select>
   </div>

Open in new window

0
philosullivan
Asked:
philosullivan
  • 4
  • 3
1 Solution
 
Jason C. LevineNo oneCommented:
Hi philosullivan,

Where is the data list coming from?
0
 
philosullivanAuthor Commented:
it's coming from a recordset exported to xml (the same recordset is currently being displayed in a spry table) , i'm trying to use this 'column' without dupes as a filter.
0
 
Jason C. LevineNo oneCommented:
Easier solution is to run the SELECT DISTINCT command at the recordset and then go to XML.  Have two recordsets if necessary...
0
[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
philosullivanAuthor Commented:
that does seem easiest, i just didn't know if there was a spry function that i wasn't seeing in the doc.
0
 
Jason C. LevineNo oneCommented:
>> just didn't know if there was a spry function that i wasn't seeing in the doc.

There is. When creating the XMLDataSet, there's a check in the Wizard for distinct values. The caveat is that the XML dataset can only have the one column in it for it to work.

So you end up running two XML datasets or two MySQL queries no matter what.

Syntax if you're interested:

var dsWhatever = new Spry.Data.XMLDataSet("../path/to/file.xml", "rss/channel/item/column",{distinctOnLoad:true,useCache:false});

Just out of curiosity, why grade this a B if you agree the solution was good?
0
 
philosullivanAuthor Commented:
the grade was in error, if you can tell me were to go to change it to an 'A" i'll be more than happy to do so.
0
 
Jason C. LevineNo oneCommented:
If it really was in error, then just click "Request Attention" in your first post and ask a Mod to change it.  I was actually looking for feedback since I didn't really answer the initial question until after you closed it and my original post pretty much looks like a B answer.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now