I have got a Kendo TreeView:
@(Html.Kendo().TreeView()
.Name("treeview")
.BindTo((IEnumerable<TreeViewItemModel>)ViewBag.MyTree)
.Events(e => e.Select("test"))
)
Here's the Javascript function fired when selecting a node:
function test(e) {
var id = $(e.node).data("id");
var description = this.text(e.node);
//if (.....) {
// ..... something here
//}
alert('Id: ' + id + '\nDescription: ' + description);
}
The above shows an alert with the Id and Text of the node. Now, I want to check if the selected node has siblings or children and do something if it does, and some other thing if it doesn't.
How can I achieve it?