Append item - Success Callback not working

2 posts, 1 answers
  1. Dirk
    Dirk avatar
    3 posts
    Member since:
    Jul 2012

    Posted 19 Aug 2013 Link to this post

    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.

    function createNewItem() {
        var tree = $("#dvTree").data("kendoTreeView");
        var selected = tree.dataItem(;
        var newnode = { text: '<new>', type:itemtype };
        newelement = tree.append(newnode, $(, function () { alert("success"); });
        if (newelement) {
            tree.trigger("select", { node: newelement });
    Am I trying a wrong approach here? Kendo UI Version is 2013.2.716.

    Thanks in advance.
  2. Answer
    Daniel avatar
    2177 posts

    Posted 21 Aug 2013 Link to this post


    You could either clear the current selection and set the selected property of the new node to true:

    tree.append({text: '<new>', type:itemtype, selected: true},;
    or use the select method in the dataBound event in order to select the new node e.g ."dataBound", function (e) {
        setTimeout(function () {
    tree.append({  text: '<new>', type:itemtype },;
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top