Hi,
I have a treeview bound to a hierarchical data source and it all loads fine
The issue is that I am using a template to set the checked flag on the check box if the datasource says the item is checked. The generated HTML shows the checked flag in the correct place for the relevant items, however the checkbox is either not checked, or parent items are checked when I don't want them to be
I think the issue is that on the data source, I am using the requestEndHandler to expand all nodes as per the documentation:
How can I prevent the expanding of the nodes from messing up my check box state setting?
Many thanks
I have a treeview bound to a hierarchical data source and it all loads fine
var treeview = $("#tree").kendoTreeView({
dataSource: treeData,
dataTextField: "Name",
checkboxes: {
template: "<
input
type
=
'checkbox'
name
=
'checkedFiles[#= item.id #]'
value
=
'#= item.id #'
#if(item.IsChecked){# checked #}#/>"
},
// listen for item selection
select: function (e) {
// don't let the item be selected
e.preventDefault();
$(':checkbox:first', $(e.node)).click();
}
}).data("kendoTreeView");
I think the issue is that on the data source, I am using the requestEndHandler to expand all nodes as per the documentation:
function requestEndHandler() {
setTimeout("expandNodes()");
};
function expandNodes() {
$("#tree").data("kendoTreeView").expand(".k-item");
};
Many thanks