13693261870
2022-09-16 354b3dbfbffb3df45212a2a44dbbf48b4acc2594
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='Ext-tree-Column'>/**
</span> * Provides indentation and folder structure markup for a Tree taking into account
 * depth and position within the tree hierarchy.
 *
 * @private
 */
Ext.define('Ext.tree.Column', {
    extend: 'Ext.grid.column.Column',
    alias: 'widget.treecolumn',
 
<span id='Ext-tree-Column-cfg-tdCls'>    tdCls: Ext.baseCSSPrefix + 'grid-cell-treecolumn',
</span>
<span id='Ext-tree-Column-property-autoLock'>    autoLock: true,
</span><span id='Ext-tree-Column-cfg-lockable'>    lockable: false,
</span><span id='Ext-tree-Column-property-draggable'>    draggable: false,
</span><span id='Ext-tree-Column-cfg-hideable'>    hideable: false,
</span>
<span id='Ext-tree-Column-property-iconCls'>    iconCls: Ext.baseCSSPrefix + 'tree-icon',
</span><span id='Ext-tree-Column-property-checkboxCls'>    checkboxCls: Ext.baseCSSPrefix + 'tree-checkbox',
</span><span id='Ext-tree-Column-property-elbowCls'>    elbowCls: Ext.baseCSSPrefix + 'tree-elbow',
</span><span id='Ext-tree-Column-property-expanderCls'>    expanderCls: Ext.baseCSSPrefix + 'tree-expander',
</span><span id='Ext-tree-Column-property-textCls'>    textCls: Ext.baseCSSPrefix + 'tree-node-text',
</span><span id='Ext-tree-Column-property-innerCls'>    innerCls: Ext.baseCSSPrefix + 'grid-cell-inner-treecolumn',
</span><span id='Ext-tree-Column-property-isTreeColumn'>    isTreeColumn: true,
</span>
<span id='Ext-tree-Column-property-cellTpl'>    cellTpl: [
</span>        '&lt;tpl for=&quot;lines&quot;&gt;',
            '&lt;img src=&quot;{parent.blankUrl}&quot; class=&quot;{parent.childCls} {parent.elbowCls}-img ',
            '{parent.elbowCls}-&lt;tpl if=&quot;.&quot;&gt;line&lt;tpl else&gt;empty&lt;/tpl&gt;&quot;/&gt;',
        '&lt;/tpl&gt;',
        '&lt;img src=&quot;{blankUrl}&quot; class=&quot;{childCls} {elbowCls}-img {elbowCls}',
            '&lt;tpl if=&quot;isLast&quot;&gt;-end&lt;/tpl&gt;&lt;tpl if=&quot;expandable&quot;&gt;-plus {expanderCls}&lt;/tpl&gt;&quot;/&gt;',
        '&lt;tpl if=&quot;checked !== null&quot;&gt;',
            '&lt;input type=&quot;button&quot; role=&quot;checkbox&quot; &lt;tpl if=&quot;checked&quot;&gt;aria-checked=&quot;true&quot; &lt;/tpl&gt;',
                'class=&quot;{childCls} {checkboxCls}&lt;tpl if=&quot;checked&quot;&gt; {checkboxCls}-checked&lt;/tpl&gt;&quot;/&gt;',
        '&lt;/tpl&gt;',
        '&lt;img src=&quot;{blankUrl}&quot; class=&quot;{childCls} {baseIconCls} ',
            '{baseIconCls}-&lt;tpl if=&quot;leaf&quot;&gt;leaf&lt;tpl else&gt;parent&lt;/tpl&gt; {iconCls}&quot;',
            '&lt;tpl if=&quot;icon&quot;&gt;style=&quot;background-image:url({icon})&quot;&lt;/tpl&gt;/&gt;',
        '&lt;tpl if=&quot;href&quot;&gt;',
            '&lt;a href=&quot;{href}&quot; target=&quot;{hrefTarget}&quot; class=&quot;{textCls} {childCls}&quot;&gt;{value}&lt;/a&gt;',
        '&lt;tpl else&gt;',
            '&lt;span class=&quot;{textCls} {childCls}&quot;&gt;{value}&lt;/span&gt;',
        '&lt;/tpl&gt;'
    ],
 
<span id='Ext-tree-Column-method-initComponent'>    initComponent: function() {
</span>        var me = this;
 
        me.origRenderer = me.renderer;
        me.origScope = me.scope || window;
 
        me.renderer = me.treeRenderer;
        me.scope = me;
 
        me.callParent();
    },
 
<span id='Ext-tree-Column-method-treeRenderer'>    treeRenderer: function(value, metaData, record, rowIdx, colIdx, store, view){
</span>        var me = this,
            cls = record.get('cls'),
            renderer = me.origRenderer,
            data = record.data,
            parent = record.parentNode,
            rootVisible = view.rootVisible,
            lines = [],
            parentData;
 
        if (cls) {
            metaData.tdCls += ' ' + cls;
        }
 
        while (parent &amp;&amp; (rootVisible || parent.data.depth &gt; 0)) {
            parentData = parent.data;
            lines[rootVisible ? parentData.depth : parentData.depth - 1] =
                    parentData.isLast ? 0 : 1;
            parent = parent.parentNode;
        }
 
        return me.getTpl('cellTpl').apply({
            record: record,
            baseIconCls: me.iconCls,
            iconCls: data.iconCls,
            icon: data.icon,
            checkboxCls: me.checkboxCls,
            checked: data.checked,
            elbowCls: me.elbowCls,
            expanderCls: me.expanderCls,
            textCls: me.textCls,
            leaf: data.leaf,
            expandable: record.isExpandable(),
            isLast: data.isLast,
            blankUrl: Ext.BLANK_IMAGE_URL,
            href: data.href,
            hrefTarget: data.hrefTarget,
            lines: lines,
            metaData: metaData,
            // subclasses or overrides can implement a getChildCls() method, which can
            // return an extra class to add to all of the cell's child elements (icon,
            // expander, elbow, checkbox).  This is used by the rtl override to add the
            // &quot;x-rtl&quot; class to these elements.
            childCls: me.getChildCls ? me.getChildCls() + ' ' : '',
            value: renderer ? renderer.apply(me.origScope, arguments) : value
        });
    }
});
</pre>
</body>
</html>