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

TreeView.treeviewFromNode breaks extensions

1 Answer 44 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 19 Jul 2012, 12:47 AM
In the newest release (kendoui.complete.2012.2.710.commercial.zip), the following method breaks anyone whose extended TreeView:

    function treeviewFromNode(node) {
        return $(node).closest("[data-role=treeview]").data("kendoTreeView");
    }

We have a "kendoTTreeView,"

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 20 Jul 2012, 12:28 PM
Hello Gary,

The treeview needs to be able to get the client-side object of other treeviews through the DOM, in order to support drag&drop of nodes between treeviews. Because we don't have the client-side object, we cannot guess what the custom name is (so that we get the proper object). Therefore, if you need to extend an existing widget (through inheritance rather than composition), don't change its name. Another option would be to attach the same client-side object to the data("kendoTreeView").

All the best,
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!
Tags
TreeView
Asked by
Gary
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or