I am building a planner which will be using the datepicker functionality in several different places. There is a general datepicker which controls the calendar, and then in different dialogs I want to have a button for opening a datepicker just for selecting a date for a field (e.g. the start date of an event).
The general datepicker is tied to a div (i.e. it's an inline datepicker), whereas the others are tied to inputs. There's a good reason why I have the one datepicker tied to a div: I need to be able to drag items onto it using draggable and droppable, which turns out to be impossible using a 'popup' datepicker.
Now, I've seen on a post at ExpertsExchange that once you have one datepicker instance initialized, its options will apply automatically to any other instance unless you specify them for the later ones. But in my case it seems everything gets tangled up: events specified for one item will fire on the other, the inline datepicker will appear after I close a popup datepickers, etc.
I'm not including real code yet because there's a lot of it, and I would first like to know if I'm missing a general principle, like "Datepicker does not allow one option to have different values for different instances because..." or "Don't mix inline and popup datepickers because..." or some such thing.
But my general idea in codespeak is:
$('div#mainDatePicker').datepicker({
//options for main (inline) datepicker, doubling as defaults for any subsequent datepickers
})
$('input#selectStartDate').datepicker({
//specific options for this datepicker, where different from the main one
})
Thanks for any help!
Wytze