I currently have export to excel functionality working for the most part, except for one or two issues.
First, in the case of exporting a grid to excel, where a column's cell is rendered to display text different than it's value (in this case, displays the territory name rather than territory id), it exports the id rather than the rendered text. Is this by design? Is there a way to export what has been rendered in the cells, rather than its stored 'value'? Keep in mind I need to keep column filtering working
Here is the colModel for the column I am referring to:
{
title: "Territories",
width: 85,
dataType: "string",
dataIndx: "territories",
editable: false,
render: function(ui) {
if (ui.rowData.territories !== undefined) {
var terrDisplay = "";
for (var i = 0, len = ui.cellData.length; i < len; i++) {
terrDisplay += territoryLookup[ui.cellData[i]];
if (i+1 < len) { terrDisplay += ","; }
}
return terrDisplay;
}
},
filter: {
type: 'select',
listeners: ['change'],
labelIndx: 'name',
valueIndx: '_id',
options: localstorage.territories,
prepend: {"": ""}
}
},
On a somewhat related note, cells in other columns (not necessarily the territories column above) with empty values are currently being exported with value 'undefined'. Is there a simple way around this little quirk as well?
Thanks!