Page 1 of 2
Clicking Next Month on Limited Datepicker
Posted: Tue Apr 09, 2013 10:36 pm
by Andres Aguilar
Hi everyone!
I've added a datepicker to my project and I limited the range so the users can click only dates from one month after or one before. The problem is, if you click the next month button (or the month before button) to access a month that is after the last permitted day, it takes you back to the Home Page. In the datebox page, in the demos, the behaviour is doing nothing when you try the same. Any suggestions?
Clicking Next Month on Limited Datepicker
Posted: Tue Apr 09, 2013 11:12 pm
by Igor
Hi Andres,
Which browser and version, you're using? any errors in console?
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 2:53 am
by Andres Aguilar
I'm using Chrome (Updated), and it happens also on the devices. It doesn't show any error in the console, it just take you back to the first page.
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 3:21 am
by Igor
Can your share app with a href="mailto:support@tiggzi.com" rel="nofollow"support@tiggzi.com/a?
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 3:52 am
by Andres Aguilar
Shared. It's not the actual project, but just a simple example of what's happening.
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 2:21 pm
by Kateryna Grynko
Hi Andres,
Datepicker Component has properties Min date and Max date that are empty by default. But in your app they're filled with some dates.
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 2:29 pm
by Andres Aguilar
Yes, I want to limit the calendar to those dates, but I don't want the datepicker to take me to my first page whenever I click Next and I'm out of range
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 2:48 pm
by Kateryna Grynko
For example it's May, 9th. If you click arrow to navigate to June then Datepicker and Datepicker page are closed.
It may be caused by the following code:
codeevent.preventDefault();
event.stopPropagation();/code
In the end off address there is "#" symbol added, this causes navigation to start screen.
An arrow to navigate to the next month is code<a href="#">/code
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 3:19 pm
by Andres Aguilar
Thanks, I see. Any solution to prevent that? Where did you find that code: codeevent.preventDefault();
event.stopPropagation();/code
Clicking Next Month on Limited Datepicker
Posted: Wed Apr 10, 2013 3:34 pm
by Kateryna Grynko
As a workaround you can hide navigation button when max date is reached. To do this on Load event add Run JavaScript action with the following code:
codeTiggzi('datepicker1').datepicker_dataPickerOptions.hideIfNoPrevNext = true;
Tiggzi('datepicker1').initializeDataPicker();/code
Replace "datepicker1" with the component name.