[model,refactor][m]: (refs #6, refs #10) get rid of DocumentSet merging its functionality into Dataset.

* In addition fully remove remaining references in models (in getRows and getLength functions) to form of backend (this should have been in previous commit).
This commit is contained in:
rgrp
2011-11-05 20:20:31 +00:00
parent 21d9a1c2dc
commit 3a48044a76
4 changed files with 39 additions and 37 deletions

View File

@@ -14,12 +14,15 @@ recline.DataTable = Backbone.View.extend({
initialize: function() {
var that = this;
this.model.fetch().then(function() {
that.render()
that.model.getRows().then(function(rows) {
that._currentRows = rows;
that.render()
});
})
},
toTemplateJSON: function() {
var modelData = this.model.toJSON()
modelData.rows = _.map(modelData.rows, function(row) {
modelData.rows = _.map(this._currentRows, function(row) {
var cellData = _.map(modelData.headers, function(header) {
return {header: header, value: row[header]}
})