Datepicker loses readonly status on kendo.bind

1 Answer 103 Views
Date/Time Pickers
CDC
Top achievements
Rank 1
CDC asked on 06 Oct 2022, 12:17 AM

It seems that if you set a data-format (or other options like data-min, data-max) on a datepicker and call kendo.bind then the readonly status is lost.  Is this the expected behavior, as it doesn't seem correct?

See example:

https://dojo.telerik.com/igORIMaX/2

 

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 10 Oct 2022, 11:48 AM

Hello,

Thank you for providing a Dojo example!

This problem is related to the following issue:

https://github.com/telerik/kendo-ui-core/issues/6885 

First, the widgets are initialized by calling the kendo.init() method. Then, when the bind() method is called the widgets are initialized once again. To improve performance, instead of going through the entire initialization process all over again, the bind() method calls the setOptions method of the already initialized widget.

This leads to the described problem.

Workaround

Calling the readonly method after the initialization is the correct workaround at the moment(you've already done that).

Aside from that, the kendo.bind() method also initializes the widgets, so it is a bit of a duplicate work to first call kendo.init and then kendo.bind.

I would recommend that you call just kendo.bind. As long as you don't use setOptions, the problem should not appear.

Dojo

https://dojo.telerik.com/@gdenchev/UnoVOyoS 

Let me know if you have any questions.

Best Regards,
Georgi Denchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Date/Time Pickers
Asked by
CDC
Top achievements
Rank 1
Answers by
Georgi Denchev
Telerik team
Share this question
or