Kendo DatePicker最大日期问题 [英] Kendo DatePicker Max date issue

查看:1620
本文介绍了Kendo DatePicker最大日期问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个kendo DatePickers可以选择作业的开始和结束日期。作业包含多个任务,其中包含自己的完成日期(任务列在网格中,每个记录中使用kendo DatePicker选择完成日期)



我设置max和min当用户设置作业的开始和结束日期时,每个任务。我使用kendo绑定kendo(通过kendo敲除)数据。



问题是当用户清除作业的结束日期时,我设置任务级别的最大日期DatePicker到(2099,11.31),但是当我点击任务级别的日期列表时,我不能一次导航到下个月。如果我点击某个其他的datepicker可以导航。当我删除工作级别的开始或结束日期时,会发生这种情况。

解决方案

这个问题似乎并没有被活跃,仅供参考,我设法绕过这个问题在设置新值后,在kendo控件上调用.enable()(我使用的是ko + ko-kendo,但是除了它完全一样)
Fiddle: http://jsfiddle.net/AlexPaven/m5M46/2/



小提琴中的代码:

  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(); //注释这表现出问题 - 最大限制不是视觉更新
},3000);

我确信这没有副作用;如果要保持启用状态,我确信您可以检查状态,并调用enable + disable或禁用+ enable。



Jeez,这很烦人。 p>

编辑:错了,我被一些更多的涉及的行为所愚弄。只有在每次设置新的最大值时打开datepicker,才会得到错误;第一次认识到这个变化,但是后来的时候不是这样。我会再花几分钟,我想...


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.

解决方案

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...

这篇关于Kendo DatePicker最大日期问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆