I need a simple sample for doing a custom treeview template (not the checkbox template), where the template gets an instance of the node or node's data, so I can change the output based on the data. I have tried doing it like the grid ones shown in this forum, but if I set a breakpoint in devtools, I can see that my function doesn't seem to be getting anything on the argument. It does render the template though. I had it working as a string using a kendo template, but then couldn't call something back on my component, so figured I need a "proper" Vue template for it. Maybe I'm missing something simple here.
My method that is returning the template:
public itemTemplate(e: any): any {
return {
template: FieldGroupTemplate,
templateArgs: e
}
}
My template component (we use Typescript):
import Vue from "Vue";
import Component from "vue-class-component";
import { Prop } from "vue-property-decorator";
import { lazyInject } from "Areas/Ordering/OrderingIocContainer";
@Component({
template: "<div>{{ templateArgs.name }}</div>",
components: {
}
})
export default class FieldGroupTemplate extends Vue {
public templateArgs!: any;
constructor() {
super();
}
}
Some markup, from where a template has the treeview:
<kendo-tree-view id="fieldSelectorTreeView" :data-source="items"
@@select="select"
:data-text-field="'name'"
:checkboxes="checkboxes"
:template="itemTemplate"
@@check="check" style="height:615px">
</kendo-tree-view>