Hi, I want to get the id of the checkbox the user clicks on, but it doesn't seem like it's working. Thank you all in advance.
@(Html.Kendo().TreeView()
.Name("treeview")
.HtmlAttributes(new {@class="demo-section" })
.Checkboxes(checkboxes => checkboxes
.Name("checkedGuide")
.CheckChildren(true)
)
.DataTextField("Name")
.DataSource(dataSource => dataSource
.Read(read => read
.Action("GetTree", "AuthService")
)
)
)
<script>
$("#treeview").on("change", ":checkbox", function (e) {
var data = $("#treeview").data('kendoTreeView').dataItem(e.node);
alert(data.id);
});
</script>
@(Html.Kendo().TreeView()
.Name("treeview")
.HtmlAttributes(new {@class="demo-section" })
.Checkboxes(checkboxes => checkboxes
.Name("checkedGuide")
.CheckChildren(true)
)
.DataTextField("Name")
.DataSource(dataSource => dataSource
.Read(read => read
.Action("GetTree", "AuthService")
)
)
)
<script>
$("#treeview").on("change", ":checkbox", function (e) {
var data = $("#treeview").data('kendoTreeView').dataItem(e.node);
alert(data.id);
});
</script>