datahub/_includes/example-backends-online-csv.js
Rufus Pollock 095f64e1f3 [fixes #444,csv][s]: remove csv backend as now in own repo.
* Moved to https://github.com/okfn/csv.js in Feb and been improving since
* Updated the docs to reflect the removal (plus did some other improvements to backend docs at same time)
2014-08-16 18:12:18 +01:00

21 lines
617 B
JavaScript

// Create the dataset in the usual way
// Note the additional options you can specify for parsing the CSV file
var dataset = new recline.Model.Dataset({
url: '{{page.root}}demos/data/sample.csv',
backend: 'csv',
// delimiter: ',',
// quotechar: '"',
// encoding: 'utf8'
});
// remember this is async so if you want to do something you need to call it in done method e.g.
// dataset.fetch.done(function(dataset) { console.log(dataset.recordCount)});
dataset.fetch();
// show the data for illustrations sake
var grid = new recline.View.SlickGrid({
model: dataset
});
$('#my-online-csv').append(grid.el);