ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: seb on November 16, 2018, 03:33:50 pm
-
Hello,
When I export a grid with dates in a column, the dates appear as text in Excel, rather than a true date object. I have set the PQGrid column dataType: "date", so I thought this would have worked.
Please can you advise the correct method for exporting date columns?
Thank you,
Seb
-
Dates are exported as date objects in the examples.
What's the complete date column definition in your case, specifically column.render and column.format.
-
Hi,
My column model looks like this:
colModel: [
{ title: "Date Added", width: 100, dataType: "date", dataIndx: "date_of", format: "dd/mm/yy" }
]
My export code looks like this:
function exportGrid() {
var blob = $grid.pqGrid("exportData", {
url: "/api/excel/export.php",
format: "xlsx",
render: true,
type: "blob",
filename: "export",
sheetName: "Export"
});
}
But when I open the Excel file, the date has come through as a string, and I have to manually convert it to a date by couble-clicking in the cell.
Thanks,
Seb
-
Works fine for me with that column definition.
Any way to reproduce the issue in the demos or share a jsfiddle so that I can look into it.