diff --git a/src/model.js b/src/model.js index b6a9461a..99494134 100644 --- a/src/model.js +++ b/src/model.js @@ -16,6 +16,7 @@ my.Dataset = Backbone.Model.extend({ // ### initialize initialize: function() { + var self = this; _.bindAll(this, 'query'); this.backend = null; if (this.get('backend')) { @@ -35,8 +36,9 @@ my.Dataset = Backbone.Model.extend({ this.facets = new my.FacetList(); this.recordCount = null; this.queryState = new my.Query(); - this.queryState.bind('change', this.query); - this.queryState.bind('facet:add', this.query); + this.queryState.bind('change facet:add', function () { + self.query(); // We want to call query() without any arguments. + }); // store is what we query and save against // store will either be the backend or be a memory store if Backend fetch // tells us to use memory store