Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1490
valueChanging event doesn't fire fast enough if a second datePicker drop down clicked
posted

I have 2 date pickers that are serving as a date range. When the user picks a date in the first one, I want to set the minValue property of the 2nd one based on the value chosen in the first one. 

I'm using the valueChanging (and also tried the valueChanged property as well), and the timing of it is not working out well. You can see in the attached example, when I do the following it is not working the way I want. 

1. Using the drop down button, pick today's date in the first editor. 

2. Immediately afterwards click the drop down button on the 2nd editor, and you will see that the 2nd editor does not have the minValue updated correctly. 

Note that if you make the calendar disappear and then click on the 2nd drop down AGAIN, the minValue is set correctly - so I know it is a timing issue. Also note that if you tab out of the first editor after picking date, and THEN click 2nd drop down, the min date is set correctly as well. 

Is there another way around this? 

date range.zip
  • 9190
    Offline posted

    Hello Ryan Rupp,

    Thanks for post on our forums. I will be happy to assist you.

    Please note, according to the igDatePicker API (Link), the valueChanging and valueChanged events are raised when the value for the editor changes. When performing the steps you provided, the value doesn't change until you click on the second igDatePicker. Instead of using these events that fire on Blur, I recommend using either the textChanged or hideDropDown event for setting the minValue for the second igDatePicker. You can test this with the sample I've attached.

    Please let me know if you have any questions regarding this matter.

    date range.zip