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

[Solved] Setting a filter causes treeview to lose important dom attributes

1 Answer 108 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 13 Oct 2014, 04:59 PM
I have a treeview and implement drag and drop. I noticed that when I set a filter on the datasource, the treeview loses attributes like:

data-role="draggable"
data-role="drop-target"
data-expanded="true"

And the drag and drop stops working.

See this dojo for an example. Examine the dom to see the attributes are there on the first tree node. Click the "Set Filter" button, and observe the attributes are gone.

http://dojo.telerik.com/AvASa/6

This seems like a bug.. Maybe I'm doing something wrong here?

Thanks,
Ryan

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 14 Oct 2014, 01:25 PM
Hello Ryan,

Instantiating widgets in the TreeView is not supported. If you need to work with Drag&Drop in the TreeView, use the dragAndDrop configuration option. You can restrict which items are draggable via a dragstart event handler (see the third example). Any modifications to the DataSource will re-render the TreeView, by design, and remove any custom attributes.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or