TreeType

class webix.TreeType()

Treetype mixin

Referenced by

views
tree(), treetable().

External references

Official documentation page.

Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
webix.TreeType={
    space:function(obj,common){
        var html = "";
        for (var i=1; i<obj.$level; i++)
            html += "<div class='webix_tree_none'></div>";
        return html;
    },
    icon:function(obj,common){
        if (obj.$count){
            if (obj.open)
                return "<div class='webix_tree_open'></div>";
            else
                return "<div class='webix_tree_close'></div>";
        } else
            return "<div class='webix_tree_none'></div>";
    },
    checkbox:function(obj, common){
        if(obj.nocheckbox)
           return "";
        return "<input type='checkbox' class='webix_tree_checkbox' "+(obj.checked?"checked":"")+(obj.disabled?" disabled":"")+">";
    },
    folder:function(obj, common){
        if (obj.icon)
            return "<div class='webix_tree_file webix_tree_"+obj.icon+"'></div>";

        if (obj.$count){
            if (obj.open)
                return "<div class='webix_tree_folder_open'></div>";
            else
                return "<div class='webix_tree_folder'></div>";
        }
        return "<div class='webix_tree_file'></div>";
    }
};