I am trying to add a checkbox column to a grid for Kendo UI Vue. The column needs to reflect a boolean field in the grid datasource. I know I can add a checkbox column for selection as per here: https://www.telerik.com/kendo-vue-ui/components/grid/selection/, but this doesn't really suit as I need a column bound to a datasource field.
My grid looks like this:
<kendo-grid v-once :data-source="myViewModel.gridDataSource">
<kendo-grid-column- :template="checkboxTemplate" :width="100" :sortable="false"></kendo-grid-column->
<kendo-grid-column field="Field 1" title="Field 1"></kendo-grid-column>
<kendo-grid-column field="Field 2" title="Field 2"></kendo-grid-column>
</kendo-grid>
The html for the template looks like this:
<template id="checkboxTemplate">
<input type="checkbox" id="exampleCheck1" />
</template>
A checkbox template is defined in the Vue component as:
new Vue({
...
data: {
checkboxTemplate: this.checkBoxTemplate
}
...
And the method it calls is:
public get checkBoxTemplate() {
debugger;
// debugger gets hit, but I have no idea what to return here.
return new Object();
}
For far, when the page renders the grid column is completely empty, no checkbox just an empty td element:
<td role="gridcell"></td>
Does anyone know what I have to do here to create a checkbox column and bind it to a field in the Vue datasource?