<!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> '<tr data-boundView="{view.id}" data-recordId="{record.internalId}" data-recordIndex="{recordIndex}" class="{[values.itemClasses.join(" ")]} ' + Ext.baseCSSPrefix + 'grid-wrap-row">',
|
'<td class="' + Ext.baseCSSPrefix + 'grid-rowwrap ' + Ext.baseCSSPrefix + 'grid-td" colSpan="{columns.length}">',
|
'<table class="' + Ext.baseCSSPrefix + '{view.id}-table ' + Ext.baseCSSPrefix + 'grid-table" border="0" cellspacing="0" cellpadding="0">',
|
'{[values.view.renderColumnSizer(out)]}',
|
'{%',
|
'values.itemClasses.length = 0;',
|
'this.nextTpl.applyOut(values, out, parent)',
|
'%}',
|
'</table>',
|
'</td>',
|
'</tr>', {
|
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 < len; ++i) {
|
items[i].colSpan = colspan;
|
}
|
}
|
});</pre>
|
</body>
|
</html>
|