KENDOUI:使用datePicker插件编辑网格弹出窗口不会更新其时间值 [英] KENDOUI: Grid Popup Edit with datePicker Plugin not updating its time value

查看:104
本文介绍了KENDOUI:使用datePicker插件编辑网格弹出窗口不会更新其时间值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Web应用程序中有一个Kendo ui网格.我可以通过弹出窗口编辑直接创建一个新的数据集.给定的字段可用作datePicker.

I've got a Kendo ui grid within my web application. I can directly create a new dataset with popup editing. A given field is usable as datePicker.

我的问题是,如果我在上午8点登录到我的Web应用程序,然后在下午单击创建数据"按钮,则该字段将在上午8点填充.

My Problem is, if I logon to my webapplication @ 8 a.m. and click on the create data button in the afternoon the field is populated with 8 a.m.

如果从网格的工具栏调用create函数,如何强制datePicker刷新?

how can I force the datePicker to refresh, if I call the create function from the toolbar of my grid?

推荐答案

好的,我找到了解决方案.愿它能帮助别人.您可以使用网格本身的edit函数来设置给定列的值:

Okay I found the solution. May it will help someone else out. You can use the edit function from the grid itself, to set the value of a given column:

edit: function(e){
    if (e.model.isNew()) {
         e.model.set("jtrDate", new Date());
    }
}

在我的示例中,我的列名称为jtrDate.

As in my example, my column Name is jtrDate.

网格编辑功能

这篇关于KENDOUI:使用datePicker插件编辑网格弹出窗口不会更新其时间值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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