This is a migrated thread and some comments may be shown as answers.

How to append id with text?

1 Answer 54 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tayger
Top achievements
Rank 1
Iron
Tayger asked on 31 Dec 2016, 05:20 PM

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

 

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 02 Jan 2017, 08:44 AM

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.
Tags
TreeView
Asked by
Tayger
Top achievements
Rank 1
Iron
Answers by
Alex Gyoshev
Telerik team
Share this question
or