ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: qfinsoft on June 10, 2015, 11:43:53 pm
-
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!
-
1) rendered cells are not exported but only the data is exported.
2) There is property column.copy which when set to false could be used to prevent export of certain columns.
http://paramquery.com/pro/api#option-column-copy
-
Hi,
Is there any way or workaround to export the rendered cells ? In that way it solves two issues,
1. It will prevent showing Id instead of Value(in drop-down columns) and
2. other it would prevent displaying 'undefined' where some cells are blank..
Appreciate in advance.
Regards.
-
Currently there isn't a way to export the rendered cells.
But it has been added as an option in the upcoming version .
-
Thank you very much.