further refactoring

This commit is contained in:
Max Ogden
2011-11-03 19:13:17 +00:00
parent 9674e10119
commit 2ec378997e
2 changed files with 29 additions and 25 deletions

View File

@@ -2,26 +2,27 @@ this.recline = this.recline || {};
// A Dataset model.
recline.Dataset = Backbone.Model.extend({
initialize: function(data, rawTabularData) {
this.tabularData = new recline.TabularData(rawTabularData);
initialize: function(data, rawDocumentSet) {
this.documentSet = new recline.DocumentSet(rawDocumentSet);
}
// get TabularData object associated with this Dataset
//
// async (as may involve getting data from the server) implementing standard promise API
, getTabularData: function() {
var dfd = $.Deferred();
dfd.resolve(this.tabularData);
return dfd.promise();
}
});
// TabularData model
recline.TabularData = Backbone.Model.extend({
recline.Document = Backbone.Model.extend({});
recline.DocumentList = Backbone.Collection.extend({
// webStore: new WebStore(this.url),
model: recline.Document
})
recline.DocumentSet = Backbone.Model.extend({
fetch: function(options) {
options.success(this);
},
getLength: function() {
return this.get('rows').length;
}
, getRows: function(numRows, start) {
},
getRows: function(numRows, start) {
if (start === undefined) {
start = 0;
}
@@ -33,4 +34,5 @@ recline.TabularData = Backbone.Model.extend({
dfd.resolve(results);
return dfd.promise();
}
});
});