How to append id with text?

2 posts, 0 answers
  1. Tayger
    Tayger avatar
    191 posts
    Member since:
    Jan 2015

    Posted 31 Dec 2016 Link to this post

    Hello

    I wonder how I can append a treeview item WITH an id? I tried it in two ways:

    var treeview = $("#treeview2").data("kendoTreeView");
     
                treeview.append({
                    text: 'mytext',
                    id: 'should work',    // option1
                    attr: {                      // option 2
                        id: 'works on menu'
                    }
                }, $('#treenode1'));

     

    Text will always be shown, but ID will never be attached, neither defined directly as ID (option1), nor over ATTR as show above by option 2 (but that works in KendoUI menu).

    Do I miss something or is it not possible that way?

    Regards

     

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2527 posts

    Posted 02 Jan 2017 Link to this post

    Hello Tayger,

    I'm afraid that this functionality is not available with the TreeView. However, you can add the ID after the node has been added, via the callback handler on the append method. See this Dojo snippet.

    Regards,
    Alex Gyoshev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top