Within a Django application, I'm using SlickGrid to bind some XHR data to a client-side spreadsheet:
var grid;
var review_url = '/api/reviews/?t=' + current_tcode;
$.getJSON(review_url, function(data) {
grid = new Slick.Grid("#myGrid", data, columns, options);
});
I'd also like to give the user the option to download the data as a CSV file. What is the best approach to doing this?
- Simply link to a CSV file that I render myself (with Piston, which I'm already using for the API).
- Do something clever using SlickGrid to output CSV data on the client side.
- Something else.
SlickGrid feels fully-featured enough that it might have something in-built to output CSV, but I can't find anything on a quick search.