Hi,
I have local data created in an array:
var slices = [{id: 1, shorttext: "Cat", isselected: false}
,{id: 2, shorttext: "Bird", isselected: true} ];
Turned into a datasource:
var Kslices = new kendo.data.DataSource({data: slices});
Put into a grid:
$("#rowselectorgrid").kendoGrid({
dataSource: Kslices,
columns: [{title:"Selector for row", template: $("#rowselectorTemplate").html()}]
});
The rowselectorTemplate looks like:
<script id="rowselectorTemplate" type="text/x-kendo-template">
<input id="#=id#" type="checkbox" #= isselected ? checked='checked' : '' #>
#=shorttext#
</script>
This all works very well and presents a grid with two rows:
checkbox + "Cat"
checked checkbox + "Bird"
The user can now check/uncheck the checkboxes and then click a button to do something (doesn't matter what).
Question: How do I now iterate through the rows in the grid to find the checkboxes to see whether they are checked or not (and get the id attribute of the <input> tag so I can reference the original array)? I have tried a few ways, checked the forums, etc, but am lost...
Help!
I have local data created in an array:
var slices = [{id: 1, shorttext: "Cat", isselected: false}
,{id: 2, shorttext: "Bird", isselected: true} ];
Turned into a datasource:
var Kslices = new kendo.data.DataSource({data: slices});
Put into a grid:
$("#rowselectorgrid").kendoGrid({
dataSource: Kslices,
columns: [{title:"Selector for row", template: $("#rowselectorTemplate").html()}]
});
The rowselectorTemplate looks like:
<script id="rowselectorTemplate" type="text/x-kendo-template">
<input id="#=id#" type="checkbox" #= isselected ? checked='checked' : '' #>
#=shorttext#
</script>
This all works very well and presents a grid with two rows:
checkbox + "Cat"
checked checkbox + "Bird"
The user can now check/uncheck the checkboxes and then click a button to do something (doesn't matter what).
Question: How do I now iterate through the rows in the grid to find the checkboxes to see whether they are checked or not (and get the id attribute of the <input> tag so I can reference the original array)? I have tried a few ways, checked the forums, etc, but am lost...
Help!