Fixes a bug in querystate handling. Fixes okfn/dataexplorer#120.

This commit is contained in:
Dan Wilson 2013-05-16 20:48:00 +01:00
parent 95036205b7
commit d626fab31c

View File

@ -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