Hello again :)
I hope I'm on the right way, I had a looked at this code :
http://friendpaste.com/5fZDAn7m
And now my code :
$.getJSON("results.html", function (json){
$('#results').items(json.response.docs).chain({
'.description': '{description_text}',
builder: function(root){
if(this.item().genre_facet){
//$
('.facets').chain('clone').appendTo().items(this.item().genre_facet).chain();
$
('.facets').chain('clone').appendTo(this.find('.facets_loop')).items([{"facet":"facet
1"},{"facet":"facet 2"}]).chain();
}
}
});
});
And template :
<div id="results">
<div class="item">
<b class="id"></b><br />
<p class="description"></p>
<div class="facets">
<ul class="facets_loop">
<li class="facet"></li>
</ul>
</div>
<br />
<br />
</div>
</div>
It is almost working with the uncommented line, facets are display but
the loop is on the whole "ul li"... I would like to loop only on "li".
The, I tried to use the commented line, but it is not working (I
changed the template according to the data) :
"genre_facet":["Online","Bike","Video Games"] is not "genre_facet":
["facet":"Online","facet":"Bike","facet":"Video Games"]
How to display this kind of data?
"genre_facet":["Online","Bike","Video Games"] is equal to
"genre_facet":[0:"Online",1:"Bike",2:"Video Games"]
Thank you very much!
Vincent