React/Node app server side data for ag-grid OnFilterChanged and IsExternalFilterPresent are both being triggered, but doesExternalFilterPass does not. I tried playing around with binding the functions and even forcing a trigger. Also tried getting the IsExternalFilterPresent to always return true, it still doesn't work. The main difference from the documentation example and my project is that I'm using server side data. If it is not supposed to work, in nowhere does it state in the doc that it's only client side (unlike Quick Filter which is clearly specified).
Edit: The lifecycle logic on my code. I don't know if adding how I'm fetching data from the server side is relevant. But here is the main logic I added for the external filter. This is inside the class component that renders the agGrid.
// On state change trigger filter change
componentDidUpdate (prevProps, prevState) = {
const filterChange = (prevState.filterDashboard !== this.state.filterDashboard);
if(filterChange){
console.log('filter triggered')
this.state.gridAPI.onFilterChanged()
}
}
// functions passed to my agGrid component
isExternalFilterPresent = () => {
console.log('filter present', this.state.filterDashboard);
// only trigger does filter pass if the filter is true
return this.state.filterDashboard
}
doesExternalFilterPass = (node) => {
console.log('filter pass', node)
if(this.state.filterDashboard){
for(let key in node.data){
if(node.data[key].toString().includes(this.state.filterString)) return true
}
} else return true
}