I have Json in below format (array of arrays) and defined in cshtml as an observableObject. I want to bind it using Kendo Template MVVM.
1. Can some one help how to define the kendo template to display a table using below JSON structure?
2. What should be passed as source in place of ??? So that the template displays accordingly.
3. how can we access the current item in kendo template?
{ "Type": 1, "Data": [{ "Category": "Sample Rows", "Result": [ [{"Name": "Column1", "Value": "Value1"}, {"Name": "Column2","Value": "Value2"}], [{"Name": "Column1","Value": "1"}, {"Name": "Column2", "Value": "2"}] ] } ] }
<script id="table-data-template" type="text/x-kendo-template"> <table> <thead data-template="header-template" data-bind="source: Result[0]" /> <tbody data-template="row-template" class="row-item" data-bind="source: ???"></tbody> </table> </script>
<script id="header-template" type="text/x-kendo-template"> <th data-bind="text: Name"></th> </script>
<script id="row-template" type="text/x-kendo-template"> <tr data-template="column-template" data-bind="source: ???"></tr> </script>
<script id="column-template" type="text/x-kendo-template"> <td data-bind="text: Value"></td> </script>