Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always open option #4

Open
NicoxDJ opened this issue Jan 7, 2019 · 1 comment
Open

Always open option #4

NicoxDJ opened this issue Jan 7, 2019 · 1 comment

Comments

@NicoxDJ
Copy link

NicoxDJ commented Jan 7, 2019

Hello,
Is there any change, the date picker could be always open. When you load the page, it should be open, and when you choose date, it should remain be open?
Thanks!

@bigdatarider
Copy link

Hi,
To make it always open, you just need to do the following changes:
In DatePickerX.css file, comment out "display:block" line for .date-picker-x class.

In your js file, initialize datepicker with the following codes:

var myDatepickerContainer = document.querySelector('input[id="d1"]');
   myDatepickerContainer.DatePickerX.init({
       format:"d.m.yyyy"
   });
//Show opened at initial load

myDatepickerContainer.click();

//Change selected item style if clicked on day element

$(".date-picker-x").bind("click", function(e) {
      if($(e.target).closest('.dpx-item').length>0) {
          $('.date-picker-x').find("*").removeClass("dpx-selected");
          $(e.target).addClass("dpx-selected");
      }
      });

Have a nice day :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants