Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using react-datepicker with agGrid

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/

like image 776
Martina Carter Avatar asked Oct 23 '25 13:10

Martina Carter


1 Answers

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

like image 87
Shuheb Avatar answered Oct 25 '25 01:10

Shuheb