剑道UI:带有自定义编辑模板的网格,使用API设置值时不会绑定DatePicker

Kendo UI: Grid with custom edit template, DatePicker won't bind when using API to set value

本文关键字:设置 API 使用 DatePicker 绑定 网格 UI 自定义 编辑 剑道      更新时间:2023-09-26

这是我的JSBin。实际上,在自定义弹出式编辑器模板中以编程方式设置Kendo DatePicker的值时,该值不会解绑定回数据源。在以这种方式设置值时,我需要调用其他方法来确保值解除绑定吗?

我JSBin

解决方案是按以下方式触发Kendo UI更改事件。

function setDate(e)
          {
            var datePicker = $("#DateCreated").data("kendoDatePicker");           
            datePicker.value(new Date());
            datePicker.trigger("change");
          }