Support sorting by a given column; refs #34
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user