Thanks
Printable View
Loiane! Thanks!
Hi,
how can I print a template column?
my grid column code is:
i have tried to change the code as descriped earlier in this threadCode:{
xtype:'templatecolumn',
tpl:'{NETPR} {WAERS}',
dataIndex: 'NETPR',
text: 'Netto'
},
but it is not working.. it's only showing an empty Netto ColumnCode:} else if (column && column.xtype === 'templatecolumn') {
convertedData[column.dataIndex] = column.tpl ? column.tpl.apply(item.data) : value;
}
I hope someone can help me.
Thanks.
Loiane! About that bug, i found the error and i fix it.
Code:var dataPrinter = [];
grid.store.data.each(function(item, row) {
var convertedData = {};
// apply renderers from column model
for (var key in item.data) {
var value = item.data[key];
Ext.each(columns, function(column, col) {
if (column.dataIndex == key) {
/*
* TODO: add the meta to template
*/
var meta = {
item : '',
tdAttr : '',
style : ''
};
value = column.renderer
? column.renderer.call(grid, value,
meta, item, row, col,
grid.store, grid.view)
: value;
varName = Ext.String.createVarName(column.dataIndex);
convertedData[varName] = value;
}
}, this);
}
dataPrinter.push(convertedData);
});
Code:
bodyTpl : ['<tpl for=".">',
'<td>\{{[Ext.String.createVarName(values.dataIndex)]}\}</td>',
'</tpl>']
}
With RowExpander of Extjs 4.1.2 doesn't work,
1- How obtain the compiled template with the data of each record?Code:Ext.each(grid.plugins, function(p) {
if (p.ptype == 'rowexpander') {
pluginsBody += p.rowBodyTpl.join(''); //In 4.1.2 rowBodyTpl is a XTemplate object
}
});
2- I want to show only the expanded rows, not all rows.
Thanks!
Ok, but the problem exists!.
"pluginsBody += p.rowBodyTpl.join('');" only appends tpl, How obtain the compiled template with the data of each record?
I want to show only the expanded rows.
Thanks!
Hey I'm using the grid printer plugin and it works great. But now I want to display the header every 30 or so rows. I'm not really that advanced with ExtJS yet so I hope someone can help me breaking up the data to add more than one header.
Thanks in advance.
Edit:
I found a solution for my problem. I added thead and tbody to my output HTML:
And then added thead styling to my stylesheet:Code:'<table>',
'<thead>',
headings,
'</thead>',
'<tbody>',
'<tpl for=".">',
body,
'</tpl>',
'</tbody>',
'</table>',
Which then results in displaying the header on every page that is printed.Code:thead { display: table-header-group; }