KENDOUI: Grid Popup Edit with datePicker Plugin not updating its time value

余生颓废 提交于 2019-12-25 02:13:32

问题


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.

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.

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


回答1:


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());
    }
}

As in my example, my column Name is jtrDate.

Grid Edit Function



来源:https://stackoverflow.com/questions/22245803/kendoui-grid-popup-edit-with-datepicker-plugin-not-updating-its-time-value

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