hi everyone,
I was playing with datepicker and found it works in next modes (in terms of datepicker, ref. _attachDatepicker() function):
*
inline mode, when it sets listeners and waits for the click to open
*
connected mode, when it displays "statically" on the page
Unfortunately, I need the third mode, very close to the "connected" one, but with some features from "inline".
To understand what I mean, please, check the next picture:
It's a mock.
Some description: when user clicks on some button (on this image it's button next to the input), such dialog appears to allow to user to select straight date or some relative date (it's functionality doesn't matter for now).
So, again, on some click I need to bring in front of a user some piece of html code with two tabs there on one of them will be a datepicker and on the other tab will be some UI other components.
And I need from datepicker to stay on that tab, don't disappear, interact with user and show the Close button (on the picture I renamed it to "Done").
But it's impossible, because:
1) If you try to use the datepicker in "inline" mode, then it will not appear at all, because it set's its own button (without attaching to my own button). Even if I manually call the .show() method, the datepicker will disappear on the first click on the page outside the datepicker. So, inline mode doesn't help here.
2) If you run the datepicker in "connected" mode, then it will remain on the tab even if you click outside of datepicker, but it will not show it's "Close" button (which can be showed only in "inline" mode).
Also, it doesn't call the onClose callback in "connected" mode, because it supposes someone else will take the date via getDate() interface.
So, what I need, is:
* to run a datepicker in "connected" mode
* with working "Close" button (derived from "inline" mode)
* and with working "onClose" callback (derived from "inline" mode)
Because I can't (or don't want) use the "inline" mode because:
* I need to hack to datepicker's code and disable _checkExternalClick() function to avoid hiding in case of external click
* I need to hack the datepicker's html to place my own Close button.
As for today, I created my own patch for datepicker, but I think it's not so good to be applied.
I strongly believe this community will help me to find some good solution to my problem.
I think what we can talk a little bit around this problem to see how I can use datepicker with my requirements.
If such usage is not possible with the current code of datepicker, I'm ready to provide my patch to achieve this.
I think that my case can have a demand among our community.
Thank you,
Dima.