PHP Code:
Ext.define('Ext.ux.grid.feature.RowSpacer', {
extend: 'Ext.grid.feature.Feature',
alias: 'feature.rowspacer',
height: 5,
spacerRowTrCls: Ext.baseCSSPrefix + 'grid-rowspacer-tr',
spacerRowTdCls: Ext.baseCSSPrefix + 'grid-rowspacer-td',
getSpacerRow: function(values) {
return [
'<tpl if="xindex != xcount">',
'<tr class="' + this.spacerRowTrCls + ' {spacerRowCls}">',
'<td class="' + this.spacerRowTdCls + '" colspan="{spacerRowColspan}" style="height: {spacerHeight}px;"></td>',
'</tr>',
'</tpl>'
].join('');
},
getMetaRowTplFragments: function() {
return {
getSpacerRow: this.getSpacerRow,
spacerRowTrCls: this.spacerRowTrCls,
spacerRowTdCls: this.spacerRowTdCls
};
},
mutateMetaRowTpl: function(metaRowTpl) {
metaRowTpl.push('{[this.getSpacerRow(values)]}');
},
getAdditionalData: function(data, idx, record, orig) {
var headerCt = this.view.headerCt,
colspan = headerCt.getColumnCount();
return {
spacerHeight: this.height,
spacerRowCls: this.spacerRowCls,
spacerRowColspan: colspan
};
}
});