skratchdot / react-bootstrap-daterangepicker

A date/time picker for react (using bootstrap). This is a react wrapper around the bootstrap-daterangepicker project.
http://projects.skratchdot.com/react-bootstrap-daterangepicker/
Other
474 stars 203 forks source link

parentEl in initialSettings - How to use #239

Closed mayurbangar closed 3 years ago

mayurbangar commented 3 years ago

Hi, I tried to use parentEl to render my daterangepicker within a specific div with id = 'my-div-id'

Different ways I tried Passing a simple string 'my-div-id' Passing a dom element using document.getElementById('my-div-id') Passing a jquery element $('#my-div-id')

None of the above methods seem to work. Could anyone please share how do I use parentEl to render my daterangepicker as a child of a specific div. initialSettings={{ startDate: state.startDate, endDate: state.endDate, ranges: state.ranges, opens: 'left', parentEl: parentEl }}

Thanks.

mayurbangar commented 3 years ago

It works with $('#mydivid') without hyphens. Maybe I missed something here before.

Thanks.