Iterating on a JSON object with autoRender

4 views
Skip to first unread message

Benno Blumenthal

unread,
May 16, 2013, 5:09:40 PM5/16/13
to Pure-Unobtrusive...@googlegroups.com
I am also having an issue with iterating over a JSON object with autorender.


{
"iridl:hasDependentVariables": {
"climatechange": {"cfatt:units": "percent",
         "iridl:hasIndependentVariables": [],
         "iridl:long_name": "Century-long Shifts",
         "iridl:name": "climatechange",
         "iridl:value": "2"
},
"decadal": {"cfatt:standard_name": "lwe_precipitation_rate",
       "cfatt:units": "percent",
       "iridl:hasIndependentVariables": [],
       "iridl:long_name": "Decade-long Shifts",
       "iridl:name": "decadal",
       "iridl:value": "20"
},
"residual": {"cfatt:standard_name": "lwe_precipitation_rate",
        "cfatt:units": "percent",
        "iridl:hasIndependentVariables": [],
        "iridl:long_name": "Year-to-Year Shifts",
        "iridl:name": "residual",
        "iridl:value": "69"
}},
"iridl:name": "adataset"}

will not autoRender with

 
<table class="valid template">
<tr class="iridl:hasDependentVariables"><td class="iridl:name@class"> <span class="iridl:long_name"></span></td><td align="right" class="iridl:name@class"><span class="iridl:value"></span>%
</td></tr>
</table>

It does render if the object is replaced by an array, or if I write a directive (the same directive works for array or object).

All four possibilities are on the following sample page

https://gist.github.com/bennoblumenthal/5595084


Mic (BeeBole)

unread,
May 28, 2013, 4:33:06 AM5/28/13
to Pure-Unobtrusive...@googlegroups.com
Thank you for the example. I'll look to this problem.
However we are quite busy right now with our app, and have little time.
Reply all
Reply to author
Forward
0 new messages