jQuery UI Widgets Forums Grid exportdata and date content bug

Tagged: , ,

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 7 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • exportdata and date content bug #94462

    contreforme
    Participant

    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

    exportdata and date content bug #94464

    Peter Stoev
    Keymaster

    Hi contreforme,

    The grid fields are not in the expected format. The “type” member is missing.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.