Hello Kendo UI Team,
I'm trying to add and select a new item to a treeview with remote datasource. This works as long as the branch of the tree is already loaded. If the branch is not loaded, the append-method returns null as documented. I tried to add a success callback method but it seems as if it is never called.
Am I trying a wrong approach here? Kendo UI Version is 2013.2.716.
Thanks in advance.
I'm trying to add and select a new item to a treeview with remote datasource. This works as long as the branch of the tree is already loaded. If the branch is not loaded, the append-method returns null as documented. I tried to add a success callback method but it seems as if it is never called.
function
createNewItem() {
var
tree = $(
"#dvTree"
).data(
"kendoTreeView"
);
var
selected = tree.dataItem(tree.select());
var
newnode = { text:
'<new>'
, type:itemtype };
newelement = tree.append(newnode, $(tree.select()),
function
() { alert(
"success"
); });
console.log(newelement);
if
(newelement) {
tree.select(newelement);
tree.trigger(
"select"
, { node: newelement });
}
}
Thanks in advance.