You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have a timepicker window open and I'm selecting a time, then while it's open, I use an on change event to modify the options of another timepicker, the open timepicker seems to switch over to the one that just had its options changed.
Then, to force it to switch the context back, if I try to just change some uneeded option on the original picker, the picker window closes without letting me click a time after I've clicked an hour.
$('.multiplier-items').on('change','.timepicker.time-end',function(){varhour=$(this).timepicker("getHour");varminute=$(this).timepicker("getMinute");var$time_start=$(this).closest('.multiplier-time-item').find('.timepicker.time-start');$time_start.timepicker("option","maxTime",{hour:hour,minute:minute});//$(this).timepicker("option","junk","nothing); //need to put focus back on this time picker in the global instance});
If I check $.timepicker._curInst it still shows it's the one that's open, but when I click the hours or check the settings, it effects/matches the one changed in the change event, in this case the $time_start timepicker.
Since all the inst share the same dialog, when it does the updateTimepicker, even though inst isn't curInst, it rebuilts the html with what's to be expected from inst and redoes the bindings, so if curInst != inst, it shouldn't update the timepicker.
The text was updated successfully, but these errors were encountered:
Hi,
Thanks for taking time to examine the code and provide solutions, I will verify that but it looks good.
Also, for a start - end time usage, I have been thinking about a way to bind two timepicker together so the programmers do not have to use events and change properties to make it work.
Anyway I'll check your code and probably will inetgrate it into the main branch.
The issue with binding them together automatically is the need to give them each a unique id. That would work fine if there are only 2 timepickers on the page.
In my particular use case, there are many entries for start/end times that are dynamically added to the page. I put each one in a container so I could go up to the parent and find the related start/end box. Not sure how that could be done without having to write the code for it.
I do have one page where there's just a single box, and there wasn't much code to write.
If I have a timepicker window open and I'm selecting a time, then while it's open, I use an on change event to modify the options of another timepicker, the open timepicker seems to switch over to the one that just had its options changed.
Then, to force it to switch the context back, if I try to just change some uneeded option on the original picker, the picker window closes without letting me click a time after I've clicked an hour.
If I check $.timepicker._curInst it still shows it's the one that's open, but when I click the hours or check the settings, it effects/matches the one changed in the change event, in this case the $time_start timepicker.
Seems I was able to fix it.
Near line 1099 this:
needs to be changed to this:
Since all the inst share the same dialog, when it does the updateTimepicker, even though inst isn't curInst, it rebuilts the html with what's to be expected from inst and redoes the bindings, so if curInst != inst, it shouldn't update the timepicker.
The text was updated successfully, but these errors were encountered: