View Full Version : [CLOSED] Get grid rendered values

Dec 22, 2014, 9:17 PM
Is it possible to get record's rendered text instead of the raw store data? When exporting the grid, I want to get the text after it ran through my custom renderers. Store.GetRecordsValues returns the raw data.

Dec 23, 2014, 9:21 AM
Hi @jchau,

It is definitely possible. At least, we do that in our GridPanel Print functionality. You could review, search for "renderer".

As far as you can see we just call a Renderer for each value.

I think it is also possible to retrieve all the rendered values on the DOM level.

It seems there was a thread where I was helping with a similar request, but I don't remember exactly.

Dec 23, 2014, 1:27 PM
Thanks. I wrote a simple function to do this:

getGridSimpleHtml: function (grid) {
var columns = grid.columns,
rows = grid.getView().getNodes(),
html, i, j, row, cell;

html = '<table class="simple-table" style="width:100%">';

// build table headers
html += '<tr>';
for (i = 0; i < columns.length; i++) {
html += '<th style="width:' + columns[i].initialConfig.width + 'px">' + columns[i].text + '</th>';
html += '</tr>';

// build table rows
for (i = 0; i < rows.length; i++) {
html += '<tr>';
row = rows[i];
for (j = 0; j < row.cells.length; j++) {
cell = row.cells[j];
html += '<td>' + cell.innerText + '</td>';
html += '</tr>';
html += '</table>';
return html;