[#113,docs/tutorial][l]: tutorial-basics written giving introduction to dataset and associated functionality.

* Minor corrections to several other parts of docs.
This commit is contained in:
Rufus Pollock
2012-07-01 15:40:04 +01:00
parent a8b8c1a59a
commit 1dadc1106b
14 changed files with 301 additions and 93 deletions

View File

@@ -1,10 +1,8 @@
// Create a dataset with a Google Docs backend and a url to the Google Doc
var dataset = new recline.Model.Dataset({
url: 'https://docs.google.com/spreadsheet/ccc?key=0Aon3JiuouxLUdGZPaUZsMjBxeGhfOWRlWm85MmV0UUE#gid=0'
},
// backend name or instance
'gdocs'
);
url: 'https://docs.google.com/spreadsheet/ccc?key=0Aon3JiuouxLUdGZPaUZsMjBxeGhfOWRlWm85MmV0UUE#gid=0',
backend: 'gdocs'
});
// Optional - display the results in a grid
// Note how we can set this up before any data has arrived
@@ -15,14 +13,9 @@ var grid = new recline.View.Grid({
$('#my-gdocs').append(grid.el);
// Now do the query to the backend to load data
dataset.fetch().done(function() {
dataset.query().done(function(data) {
// The grid will update automatically
// Log some data as an example
if (console) {
console.log(data);
console.log(dataset.currentDocuments);
}
});
dataset.fetch().done(function(dataset) {
if (console) {
console.log(dataset.currentDocuments);
}
});