Hello,
consider the following
var grid_data = {
grid_fields : [
{name:"id"},
{name: "label"},
{name: "starts"}
],
grid_columns : [
{text:"id", datafield:"id", width:"10%", editable:false},
{editable: false,datafield: "label",displayfield: "label",text: "Label",width: "45%"},
{editable: true,datafield: "starts",displayfield: "starts",text: "Starts",width: "45%",cellsformat: "yyyy-MM-dd HH:mm", columntype: "datetimeinput"}
],
grid_data : [
{"id":"item222","label":"Session 1","starts":"2017-06-30 08:30"}
],
source = {
datatype: "json",
datafields: grid_data.grid_fields,
localdata: grid_data.grid_data
},
columns = grid_data.grid_columns,
dataAdapter = new $.jqx.dataAdapter(source);
$("#grid").jqxGrid({
width: "100%",
selectionmode: "singlecell",
altrows: true,
autoheight: true,
autorowheight: true,
height: 600,
editable: true,
columnsreorder: true,
source: dataAdapter,
columnsresize: true,
filterable: true,
theme: "metrodark",
altRows: true,
sortable: true,
columns: columns
});
$("#grid_export").click(function () {
// $(this).data('type') is 'xls' or 'csv'
$("#grid").jqxGrid("exportdata", $(this).data("type"), "my_data", true, null, false, "export.php", "UTF-8");
});
When i export the grid to CSV or XLS, the date output is changed to ‘2017-06-21 08:30 (including the single quote…)
If i dump the content received by export.php the data is already modified : “item222″,”Session 1″,”2017-06-21 08:30” (without the single quote…)
Any insight about the data manipulation made by the exportdata method that could lead to this ? An encoding problem ?
Thanks for your help