0

I am attempting to programmatically cause a filter to run doesFilterPass on component load. So far I've tried adding filterChangedCallback to componentWillMount, componentDidMount, componentWillUpdate and componentDidUpdate calls. However none of these calls trigger doesFilterPass. Triggering the filterChangedCallback from the gui, with event handlers like onChange does work. Is this a bug? Does anyone know how to consistently get doesFilterPass to run?

David Choi
  • 6,131
  • 10
  • 28
  • 28

2 Answers2

1

I spoke to the guys at ag-grid. They call this a limitation of the control. So I ended up using a timer off of the componentDidUpdate handler for 300 milliseconds to call filterChangedCallback. That's a terrible solution but it works.

David Choi
  • 6,131
  • 10
  • 28
  • 28
0

I had the same problem, so I downloaded a sample react code from here ag-grid-react-example and read code.

Try to call filterChangedCallback() in this.SetState like this:

this.setState({stateList}, this.props.filterChangedCallback);

It worked for me.

sasquad
  • 1
  • 1