Dojo Enhanced Grip: Export to CSV. Formatting Date Object in CSV?

838
1
02-03-2014 09:23 AM
IrfanClemson
Occasional Contributor II
Hi,
I have a Dojo Enhanced Grid which is populated by data from an ESRI query. One of the data fields ("DateRetrieved") is a SQL Server date field; ESRI's query converts that into a numeric data value. I then use javascript to format and display that in the Dojo Enhanced Grid. So far so good. But I when export the Grid to a .CSV file the numeric date value gets exported instead of the displayed/formatted date value from the Grid.

I thought I could some kind of function during the export which would look for the DateRetrieved column's values and then formats using javascript before the CSV data gets sent to the .NET application. But I can't find anyone who has something like that.

Anyway, here is code snippet which is being used.

Thank you!

griddata.exportGrid("csv",{ 
               writerArgs: { separator: "," } 
              }, 

        function(str){ 
                   //here the data gets posted to a .NET page. Works fine
                    } 
     ); 
0 Kudos
1 Reply
IrfanClemson
Occasional Contributor II
Never mind. I formatted the date in the Results before making to the grid and CSV. All fine now.
Thanks.
0 Kudos