Salient Solutions

wrasslin ones and nones for fun and profit - Sky Sanders' Blog
posts - 96, comments - 70, trackbacks - 0

September 2010 Entries

JSON to CSV

  I recently had need to copy a grid to clipboard as CSV and after a brief googling concluded that I needed to roll my own. Here it is.   // function jsonToCSV(sourceRows, omitHeader, fieldsToIgnore) { /// <summary> /// Converts an array of JSON objects to CSV. ///</summary> /// <param name="sourceRows" type="Object[]"> /// An array of objects containing a single level of scalar fields. /// e.g. [{ foo: "bar", fu: true }, { foo: "baarbar", fu: false }] /// /// The...

posted @ Sunday, September 19, 2010 11:49 AM | Feedback (1) |

Powered by: