Hello,
We have a Kendo Grid UI that is databound with a remote JSON.
We want to use the build-in Popup window to add and edit a row.
Now there is one value that needs to be bound to a treeview.
The treenode with the ID of the databound Item should be preselected.
The new value of the selected node should be submitted to the webservice.
Neither is happening.
The TreeView is correctly shown. But is not selecting the right node.
Here my code :
/*
1 PART of the Grid
*/
editable: {
mode: "popup",
template: kendo.template($("#popup-editor-werkaanvraag").html())
},
edit: function(e){
var inlineDefault = new kendo.data.HierarchicalDataSource({
data: [
{text: "KK",id:0, items: [
{text: "Hoofdgebouw",id:150},
{text: "Pav 1",id:151},
{text: "Pav 2",id:152}
]},
{text: "SRF",id:1, items: [
{text: "Bed Linen",id:154},
{text: "Curtains & Blinds",id:155},
{text: "180",id:180}
]}
]
});
}
var treeview = e.container.find(".nested-treeview").kendoTreeView({
dataSource: inlineDefault
});
}
/*
2 PART of the Template
*/
<script id="popup-editor-werkaanvraag" type="text/x-kendo-template">
<div style="width:800px" date-role="treeview" class="nested-treeview" data-bind="value:locatie_id" ></div>
</script>