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

Sorting for a TreeView

1 Answer 170 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 18 Apr 2012, 10:07 AM
Hi,
I am dynamically building a ul and then applying a kendoTreeView() on it everything is working prefectly fine but I am struggling to sore the tree as there is no method provided and I can't apply any logic as i am building very complicated ul.
My code as below:
function BuildTree() {
    $(xmlDoc.getElementsByTagName("Item")).each(function () {
 
        var thisItem = $(this);
        var list = " "; var list1 = " ";
        $(parentIDFields).each(function (index, item) {
 
            if (thisItem.attr(item) != null && thisItem.attr(descriptionCol) != null) {
                if (index == 0) {
                    list += "<li id=" + thisItem.attr("ID") + " onclick=sendHTML(" + thisItem.attr("ID") + ");>" + thisItem.attr(item);
                    list1 += "</li>";
                }
                else {
                    list += "<ul><li id=" + thisItem.attr("ID") + " onclick=sendHTML(" + thisItem.attr("ID") + ");>" + thisItem.attr(item);
                    list1 += "</li></ul>";
                }
            }
        });       
        $("#treeView").append(list + "<ul><li id=" + thisItem.attr("ID") + ">" + thisItem.attr(descriptionCol) + " </li></ul>" + list1);
    });
 
    $(document).ready(function () {
        $("#treeView").kendoTreeView();
    });
 
}

can you please show any pointers towards solution.

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 18 Apr 2012, 12:30 PM
Hello James,

This functionality is currently unsupported. You need to sort the data before initializing the treeview.

You can submit a feature request for that on uservoice.

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
James
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or