Using array as data input
lyndametref opened this issue · 2 comments
lyndametref commented
I am using jquery-template to generate layout from data retrieved from a database. In one of the database result, an object is an array and I want to create one html element per item of the array. I have managed to do that with the following code:
<script type="text/html" id="myTemplate">
<input type="checkbox" data-value=""/>
<label data-content=""/>
<br/>
</script>
$("#myDiv").loadTemplate $("#myTemplate"),myArray
Since I haven't seen any documentation about the use of array, I am wondering if this behaviour is intended or it works by chance and might break in future release?
codepb commented
This is totally intended behaviour. It is an oversight that it isn't mentioned in the documentation. If you look at the included examples, the second example is using an array, and displays the paging functionality that is also included.
lyndametref commented
Thank you very much!