This is a migrated thread and some comments may be shown as answers.

disableDates in custom edit template with data attributes

1 Answer 79 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Iago
Top achievements
Rank 1
Iago asked on 18 May 2018, 10:32 AM

Hi,

I'm using a custom popup edit template for my grid where I'm using a datetimepicker with data attributes.

I would like to use disableDates function to allow only a range between [PlannedFromTemp, PlannedToTemp], but until now I was not able to pass the "date" argument in the function as in the documentation here.

 

How can I pass the "date" in my test function as in the documentation, but in my concrete custom template?

 <input id="Timefrom" name="Timefrom"
               data-type="date"
               data-role="datetimepicker"
               data-bind="value: Timefrom"
               data-format="dd.MM.yyyy HH:mm"
               data-time-format="HH:mm"
               data-disable-dates="#= test(date, PlannedFromTemp, PlannedToTemp) # " 
             
              />

 

Thank you in advance,

 

 

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 22 May 2018, 11:27 AM
Hi, Iago,

Unfortunately, using this syntax will not lead to the desired result. Instead, I would suggest using the edit event of the grid, where the model will be available and the setOptions() method of the Kendo UI DateTimePicker to calculate which dates should be disabled. I prepared an example which disables several dates based on the value of the model:

https://dojo.telerik.com/@bubblemaster/abUGaWED

I hope this helps, let me know if you have further questions.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Date/Time Pickers
Asked by
Iago
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or