diff --git a/src/mw-backbone/collection/filterable.js b/src/mw-backbone/collection/filterable.js index 713cc975..5d68df92 100644 --- a/src/mw-backbone/collection/filterable.js +++ b/src/mw-backbone/collection/filterable.js @@ -152,11 +152,17 @@ mwUI.Backbone.Filterable = function (collectionInstance, options) { return _sortOrder; }; - this.setFilters = function (filterMap) { + this.setFilters = function (filterMap, options) { + options = options || {}; _.forEach(filterMap, function (value, key) { if (_.has(this.filterValues, key)) { this.filterValues[key] = value; + var filterValue = {}; + filterValue[key] = value; + if(_.isUndefined(options.silent) || !options.silent){ + collectionInstance.trigger('change:filterValue', filterValue); + } } else { throw new Error('Filter named \'' + key + '\' not found, did you add it to filterValues of the model?'); } @@ -164,7 +170,6 @@ mwUI.Backbone.Filterable = function (collectionInstance, options) { this.setPage(1); this.filterIsSet = true; - }; this.getFilters = function () {