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

preservation of data-uid or other id's

2 Answers 347 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Martijn
Top achievements
Rank 1
Martijn asked on 23 Jul 2012, 11:38 AM
From my backend it generate a treeview using a ul/li construction:

<ul id="treeView">
        <li data-uid="8f04cb75-1a2a-4c9b-95c6-4a44d963505c" data-parent="">Root
         <ul>        
<li data-uid="64ca06a9-72b3-4444-b951-f46e0378b26b" data-parent="8f04cb75-1a2a-4c9b-95c6-4a44d963505c" ">1.1
            <ul
        </li>
</ul>

However, when I take a look when after init the kendoui treeview, the data-uid's are all randomly recreated.

From there, I took a different approach and used the id attribute for the identifiying the node. However, when a node is drag & dropped the resulting node does not contain the id. Also when custom attributes are used for this purposes the Id of the node is gone.

This leave the treeview completely useless, since postingback to the server is impossible.

So the question is, howto preserve the id's??

2 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 23 Jul 2012, 01:20 PM
Hello Martijn,

If you bind the treeview to a HierarchicalDataSource (rather than initializing it from HTML), you will be able to leave the custom fields in the datasource and access them through the dataItem method.

Greetings,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
David
Top achievements
Rank 1
answered on 16 Mar 2013, 12:54 AM
here is a fiddle
http://jsfiddle.net/S3mYb/
Tags
TreeView
Asked by
Martijn
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
David
Top achievements
Rank 1
Share this question
or