Kendo DatePicker Max date issue

匿名 (未验证) 提交于 2019-12-03 01:38:01

问题:

I have a two kendo DatePickers to select start and end date of a job. job consists of multiple tasks which contains its own completion date (tasks are listed in a grid with kendo DatePicker for each record to select the completion date)

I set max and min of each task when user sets the job start and end date. I use kendo to bind data with kendo (through kendo knockout).

problem is when user clears the end date of a job,I set the max date of task level DatePicker to (2099, 11.31), but when I click on the task level datepicker I cant navigate to next month at once. if i click on some other datepicker can navigate. this happens when I delete start or end date of the job level.

回答1:

Well this question doesn't seem to be 'active' anymore but for reference, I managed to get around the problem by calling .enable() on the kendo control after setting the new value (I was using ko + ko-kendo but other than that it's exactly the same) Fiddle: http://jsfiddle.net/AlexPaven/m5M46/2/

Code in fiddle:

var vm = {     val: ko.observable(new Date()),     mx: ko.observable(new Date()) };  ko.applyBindings(vm);  setTimeout(function() {      vm.mx(new Date(2099, 11, 31));      var d = $('#a').data('kendoDatePicker');     d.enable(); // commenting this exhibits the problem - max constraint isn't updated visually }, 3000); 

I'm reasonably sure this has no side effect; if you want to preserve the enabled state I'm sure you can check the state and call enable+disable or disable+enable.

Jeez, this was annoying.

EDIT: wrong, I was fooled by the behavior which is a little more involved. You only get the bug if you open the datepicker each time you set a new maximum; the first time the change is acknowledged but subsequent times it's not. I'll spend a few more minutes with this I suppose...



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!