I have a very simple test page:
%26lt;script type=''text/javascript''
src=''/includes/javascript/spry/SpryData.js''%26gt;%26lt;/script%26gt;
%26lt;script type=''text/javascript''
src=''/includes/javascript/spry/SpryJSONDataSet.js''%26gt;%26lt;/script%26gt;
%26lt;script type=''text/javascript''%26gt;
var coaches = new
Spry.Data.JSONDataSet(''/includes/components/facade.cfc?method=getCoachesQry%26amp;ret urnFormat=json%26amp;queryFormat=column'',
{path:''DATA'',pathisObjectofArrays:true});
%26lt;/script%26gt;
%26lt;style%26gt;
.hover { background-color: yellow; }
%26lt;/style%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
%26lt;div spry:region=''coaches''%26gt;
%26lt;table width=''98%'' border=''0'' cellspacing=''2''
cellpadding=''2''%26gt;
%26lt;tr%26gt;
%26lt;th onclick=''coaches.sort('COACHFNAME','toggle')''
%26gt;First Name%26lt;/th%26gt;
%26lt;th onclick=''coaches.sort('COACHLNAME','toggle')''
%26gt;Last Name%26lt;/th%26gt;
%26lt;/tr%26gt;
%26lt;tr spry:repeat=''coaches'' spry:hover=''hover''%26gt;
%26lt;td%26gt;{COACHFNAME}%26lt;/td%26gt;
%26lt;td%26gt;{COACHLNAME}%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;/table%26gt;
%26lt;/div%26gt;
Here is the JSON as reported by Firebug:
{''ROWCOUNT'':2,''COLUMNS'':[''COACHID'',''COACHFNAME'',''COACHLNAME''],''DATA'':{''COACHID'' :[''3ebccb05-15f2-4856-230c-dd90140491f5''
,''4dfbb206-15f2-4856-2332-b644b10da11b''],''COACHFNAME'':[''Mike'',''Bob''],''COACHLNAME '':[''Smith'',''Brown''
]}}
When I run it, spry correctly treats values as appropriate
fields but seems to disregard the spry:repeat command and puts all
values in the same table cell like this:
%26lt;td%26gt;Mike,Bob%26lt;/td%26gt;%26lt;td%26gt;Smith,Brown%26lt;/td%26gt;
If I just remove spry:repeat, nothing changes.
I tried to create a smiple csv file and ran the same code
(with CSVDataSet instead of course) and it works no problem.
Cyrillspry:repeat puts all values in one row
Hi Cyrill,
You have a typo in your constructor option for your data set.
It says:
pathisObjectofArrays:true
It should be:
pathIsObjectofArrays:true
With a capital 'i' in 'Is'.
--== Kin ==--spry:repeat puts all values in one row
Thank you! Cold Fusion spoiled me with no case
sinsitivity...
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment