3

Im trying to incorporate react-date picker with ag-grid ag-grid provides documentation on using custom date picker but with using flatpickr was wondering if anyone has successfully attempted to use react-datepicker with ag-grid and if so, could provide and example?

Ag Grid example: https://www.ag-grid.com/javascript-grid/component-date/

Martina Carter
  • 409
  • 5
  • 18

1 Answers1

4

The react-datepicker is a bit more tricky to work with but I have a solution that works:

The portalId is key here, it allows us to append the popup to the root which allows the popup to be visible inside the filter menu:

<DatePicker
          portalId="root"
          popperClassName="ag-custom-component-popup"
          selected={this.state.date}
          onChange={this.onChange.bind(this)}
        />

Please see this example

Shuheb
  • 2,012
  • 1
  • 4
  • 6