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
<!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-grid-feature-RowWrap'>/**
</span> * @private
 */
Ext.define('Ext.grid.feature.RowWrap', {
    extend: 'Ext.grid.feature.Feature',
    alias: 'feature.rowwrap',
    
<span id='Ext-grid-feature-RowWrap-property-rowWrapTd'>    rowWrapTd: 'td.' + Ext.baseCSSPrefix + 'grid-rowwrap',
</span>    
<span id='Ext-grid-feature-RowWrap-property-hasFeatureEvent'>    // turn off feature events.
</span>    hasFeatureEvent: false,
    
<span id='Ext-grid-feature-RowWrap-property-tableTpl'>    tableTpl: {
</span>        before: function(values, out) {
            if (values.view.bufferedRenderer) {
                values.view.bufferedRenderer.variableRowHeight = true;
            }
        },
        priority: 200
    },
 
<span id='Ext-grid-feature-RowWrap-property-wrapTpl'>    wrapTpl: [
</span>        '&lt;tr data-boundView=&quot;{view.id}&quot; data-recordId=&quot;{record.internalId}&quot; data-recordIndex=&quot;{recordIndex}&quot; class=&quot;{[values.itemClasses.join(&quot; &quot;)]} ' + Ext.baseCSSPrefix + 'grid-wrap-row&quot;&gt;',
            '&lt;td class=&quot;' + Ext.baseCSSPrefix + 'grid-rowwrap ' + Ext.baseCSSPrefix + 'grid-td&quot; colSpan=&quot;{columns.length}&quot;&gt;',
                '&lt;table class=&quot;' + Ext.baseCSSPrefix + '{view.id}-table ' + Ext.baseCSSPrefix + 'grid-table&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;',
                    '{[values.view.renderColumnSizer(out)]}',
                    '{%',
                        'values.itemClasses.length = 0;',
                        'this.nextTpl.applyOut(values, out, parent)',
                    '%}',
                '&lt;/table&gt;',
            '&lt;/td&gt;',
        '&lt;/tr&gt;', {
            priority: 200
        }
    ],
 
<span id='Ext-grid-feature-RowWrap-method-init'>    init: function(grid) {
</span>        var me = this;
        me.view.addTableTpl(me.tableTpl);
        me.view.addRowTpl(Ext.XTemplate.getTpl(me, 'wrapTpl'));
        me.view.headerCt.on({
            columnhide: me.onColumnHideShow,
            columnshow: me.onColumnHideShow,
            scope: me
        });
    },
 
<span id='Ext-grid-feature-RowWrap-method-onColumnHideShow'>    // Keep row wtap colspan in sync with number of *visible* columns.
</span>    onColumnHideShow: function() {
        var view = this.view,
            items = view.el.query(this.rowWrapTd),
            colspan = view.headerCt.getVisibleGridColumns().length,
            len = items.length,
            i;
            
        for (i = 0; i &lt; len; ++i) {
            items[i].colSpan = colspan;
        }
    }
});</pre>
</body>
</html>