[#168,docs/backend][m]: major extension to backend tutorial to give examples of most backends.

This commit is contained in:
Rufus Pollock
2012-07-08 20:52:55 +01:00
parent 4e69026881
commit 3e2fbed5c2
7 changed files with 187 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
// 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',
// separator: ',',
// delimiter: '"',
// 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.Grid({
model: dataset
});
$('#my-online-csv').append(grid.el);