Hi.
I am trying to figure out how I get only the checked children of a node, not checked grand children.
I use this code at the moment, fires when i click on a link attached to the parent:
var tree = $("#treeview").data("kendoTreeView");
var items = $(this).closest(".k-item").find(".k-group .k-item input[type=checkbox]:checked");
items.each(function() {
var getNode = $(this).closest(".k-item");
var item = tree.dataItem(getNode);
console.log(item.id);
});
}
This code gives me all checked children, grand children and so on, but i need only the children. I tried changing the .find() filter with .children() filter, but then items is empty.
Can anyone point me in the right direction? Your help is much much appreciated.
I am trying to figure out how I get only the checked children of a node, not checked grand children.
I use this code at the moment, fires when i click on a link attached to the parent:
var tree = $("#treeview").data("kendoTreeView");
var items = $(this).closest(".k-item").find(".k-group .k-item input[type=checkbox]:checked");
items.each(function() {
var getNode = $(this).closest(".k-item");
var item = tree.dataItem(getNode);
console.log(item.id);
});
}
This code gives me all checked children, grand children and so on, but i need only the children. I tried changing the .find() filter with .children() filter, but then items is empty.
Can anyone point me in the right direction? Your help is much much appreciated.