Question

I am using jQuery and JsRender to render my template.

Here is my jsfiddle example: http://jsfiddle.net/kWBFS/8/

Could anyone please tell me how should I access values of particular arrays?

Currently I'm gettin only [object Object] and don't know how to access its contents.

Thanks a lot!

Was it helpful?

Solution

I've never used jsRender before, but this template seems to give you the correct output. You need to iterate over the items in the R1 array using a for loop:

<script id="template" type="text/x-jsrender">
    {{for R1}}
        Column: {^{:#index+1}}
        {{for #data}}
            <p>{{:K1}} {{:K2}}</p>
        {{/for}}
        <br>
    {{/for}}
    <br>
</script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top