Filter condition to apply


#1

Hey Guys i have a quick question, i need to evaluate every filter that is applied before executing the queries and cancel the application of that filter evaluating a condition, there is a way to do that?


#2

@davisg actually yes, there is a way to do it, just using the stopExecution() function, like this:

mychart.on('filter:before-add', e => {
    const filter = e.filters.find(f => f.label === 'mylabel');
    if (filter.value[0] === 'match condition') {
        const IM = cf.getIManager();
        IM.get('api'). stopExecution(); // this for stop the filter application
    }
})

#3

Wow, i never used the toolkit like that, but i tried this and it works for me, thank you so much @emoya