2 * @class Ext.grid.feature.RowWrap
3 * @extends Ext.grid.feature.Feature
6 Ext.define('Ext.grid.feature.RowWrap', {
7 extend: 'Ext.grid.feature.Feature',
8 alias: 'feature.rowwrap',
10 // turn off feature events.
11 hasFeatureEvent: false,
13 mutateMetaRowTpl: function(metaRowTpl) {
14 // Remove "x-grid-row" from the first row, note this could be wrong
15 // if some other feature unshifted things in front.
16 metaRowTpl[0] = metaRowTpl[0].replace(Ext.baseCSSPrefix + 'grid-row', '');
17 metaRowTpl[0] = metaRowTpl[0].replace("{[this.embedRowCls()]}", "");
19 metaRowTpl.unshift('<table class="' + Ext.baseCSSPrefix + 'grid-table ' + Ext.baseCSSPrefix + 'grid-table-resizer" style="width: {[this.embedFullWidth()]}px;">');
21 metaRowTpl.unshift('<tr class="' + Ext.baseCSSPrefix + 'grid-row {[this.embedRowCls()]}"><td colspan="{[this.embedColSpan()]}"><div class="' + Ext.baseCSSPrefix + 'grid-rowwrap-div">');
24 metaRowTpl.push('</table>');
26 metaRowTpl.push('</div></td></tr>');
29 embedColSpan: function() {
33 embedFullWidth: function() {
37 getAdditionalData: function(data, idx, record, orig) {
38 var headerCt = this.view.headerCt,
39 colspan = headerCt.getColumnCount(),
40 fullWidth = headerCt.getFullWidth(),
41 items = headerCt.query('gridcolumn'),
42 itemsLn = items.length,
52 for (; i < itemsLn; i++) {
54 tdClsKey = id + '-tdCls';
55 colResizerCls = Ext.baseCSSPrefix + 'grid-col-resizer-'+id;
56 // give the inner td's the resizer class
57 // while maintaining anything a user may have injected via a custom
59 o[tdClsKey] = colResizerCls + " " + (orig[tdClsKey] ? orig[tdClsKey] : '');
60 // TODO: Unhackify the initial rendering width's
61 o[id+'-tdAttr'] = " style=\"width: " + (items[i].hidden ? 0 : items[i].getDesiredWidth()) + "px;\" "/* + (i === 0 ? " rowspan=\"2\"" : "")*/;
62 if (orig[id+'-tdAttr']) {
63 o[id+'-tdAttr'] += orig[id+'-tdAttr'];
71 getMetaRowTplFragments: function() {
73 embedFullWidth: this.embedFullWidth,
74 embedColSpan: this.embedColSpan