-
9 Oct 2012 12:14 AM #51
-
15 Oct 2012 5:37 AM #52
-
15 Oct 2012 6:49 AM #53
templatecolumn
templatecolumn
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.
-
15 Oct 2012 12:53 PM #54
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>'] }
-
16 Oct 2012 10:21 AM #55
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!
-
17 Oct 2012 9:45 AM #56Sencha/Java evangelist
Author of ExtJS 4 First Look and Mastering Ext JS books
English blog: http://loianegroner.com
Portuguese blog: http://loiane.com
Sencha Examples: https://github.com/loiane
-
17 Oct 2012 4:47 PM #57
Sencha/Java evangelist
Author of ExtJS 4 First Look and Mastering Ext JS books
English blog: http://loianegroner.com
Portuguese blog: http://loiane.com
Sencha Examples: https://github.com/loiane
-
17 Oct 2012 4:51 PM #58
Sencha/Java evangelist
Author of ExtJS 4 First Look and Mastering Ext JS books
English blog: http://loianegroner.com
Portuguese blog: http://loiane.com
Sencha Examples: https://github.com/loiane
-
18 Oct 2012 3:37 AM #59
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!
-
19 Oct 2012 7:03 AM #60
Displaying multiple headers in the printpage
Displaying multiple headers in the printpage
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; }



Reply With Quote