Using crossfilter, is it possible to destroy / delete it after its creation?

Im referencing a square cross filter plugin for javascript

https://github.com/square/crossfilter

In my application, users can select specific date ranges and each time the date changes, the ajax request creates a json object that is passed to the crossfilter.

I want to delete the existing crossfilter (objects on the screen, as well as events) and start a new one with the newly created json object.

+3
source share
3 answers

According to the documentation you should be able to cancel the filter either with

.filter(null)

or

.filterAll()

to your object.

, , , , , crossfilter.

, .

+3

reset , , reset. ,

payments_by_quantity.filter([1, Infinity]);
payments_by_total.filter(90);
payments_by_tip.filter(0);
payments_by_type.filter("tab");

reset , :

payments_by_quantity.filter(null);
payments_by_total.filter(null);
payments_by_tip.filter(null);
payments_by_type.filter(null);

, / .

+1
if(crossFilter.size() > 0) {
     // Need to apply filter to all first
     dc.filterAll(); 
     // Then call remove
     crossFilter.remove();
 }
0
source

All Articles