Permalink
Browse files

Custom filter function: notify filter listeners.

  • Loading branch information...
1 parent 63d50a3 commit 5e2518fee8a2a48bc120f6d6ff5921659dbad975 @jasondavies jasondavies committed Aug 28, 2012
Showing with 8 additions and 5 deletions.
  1. +1 −0 crossfilter.js
  2. +1 −1 crossfilter.min.js
  3. +1 −0 src/crossfilter.js
  4. +5 −4 test/crossfilter-test.js
View
@@ -745,6 +745,7 @@ function crossfilter() {
}
lo0 = 0;
lo1 = n;
+ filterListeners.forEach(function(l) { l(one, [], [], true); });
return dimension;
}
View
Oops, something went wrong.
View
@@ -230,6 +230,7 @@ function crossfilter() {
}
lo0 = 0;
lo1 = n;
+ filterListeners.forEach(function(l) { l(one, [], [], true); });
return dimension;
}
@@ -296,12 +296,13 @@ suite.addBatch({
data.total.filter(null);
}
},
- "groupAll() works after custom filter function": function(data) {
+ "two custom filter functions and groupAll() calls in a row": function(data) {
try {
- data.total.filter(function(d) { return d === 100; });
+ data.total.filter(function(d) { return d === 190; });
data.all.value();
- data.total.filter([200, 300]);
- assert.equal(data.all.value(), 8);
+ data.total.filter(function(d) { return d === 100; });
+ assert.equal(data.all.value(), 4);
+ assert.equal(data.total.top(Infinity).length, 4);
} finally {
data.total.filter(null);
}

0 comments on commit 5e2518f

Please sign in to comment.