Support sorting by a given column; refs #34

This commit is contained in:
Friedrich Lindenberg
2012-02-09 18:43:06 +00:00
parent b96de6c34f
commit 5fc4fa9626
4 changed files with 14 additions and 5 deletions

View File

@@ -35,12 +35,13 @@ this.recline.Model = this.recline.Model || {};
// this does not fit very well with Backbone setup. Backbone really expects you to know the ids of objects your are fetching (which you do in classic RESTful ajax-y world). But this paradigm does not fill well with data set up we have here.
// This also illustrates the limitations of separating the Dataset and the Backend
query: function(queryObj) {
this.actualQuery = queryObj || this.defaultQuery;
this.actualQuery = _.extend({size: 100, offset: 0}, this.actualQuery);
this.queryState = queryObj || this.defaultQuery;
this.queryState = _.extend({size: 100, offset: 0}, this.queryState);
var self = this;
var backend = my.backends[this.backendConfig.type];
var dfd = $.Deferred();
backend.query(this, this.actualQuery).then(function(rows) {
backend.query(this, this.queryState).then(function(rows) {
var docs = _.map(rows, function(row) {
var _doc = new my.Document(row);
_doc.backendConfig = self.backendConfig;