I am using a jquery plugin from [ FilamentGroup ] called DateRangePicker.
I have a simple form with two text inputs for the start and end date that I bind the DateRangePicker to using this
$('input.tbDate').daterangepicker({
dateFormat: 'mm/dd/yy',
earliestDate: new Date(minDate),
latestDate: new Date(maxDate),
datepickerOptions: {
changeMonth: true,
changeYear: true,
minDate: new Date(minDate),
maxDate: new Date(maxDate)
}
});
I have a collapsible table above this form that when shown, moves the form and the elements that the daterangepicker plugin is bound to, down lower on the page, but the daterangepicker appears to keep the position from when it was actually created.
What code could I put in the daterangepicker's onShow Callback to update its position to be next to the element is was initially bound to? Or is there some specific jquery method or plugin that I could chain to the daterangepicker plugin so that it will update its position correctly. This would come in handy for some other plugins that I use that don't seem to keep their position relative to other elements correctly either.