disableDates in custom edit template with data attributes

2 posts, 0 answers
  1. Iago
    Iago avatar
    13 posts
    Member since:
    Sep 2016

    Posted 18 May Link to this post

    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,

     

     

  2. Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    489 posts

    Posted 22 May Link to this post

    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.
Back to Top