使用Datetime DatePickerFor进行Kendo Grid内联编辑 [英] Kendo Grid inline edit with Datetime DatePickerFor

查看:241
本文介绍了使用Datetime DatePickerFor进行Kendo Grid内联编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

kendo内联单元格编辑不支持日期时间格式.我需要"dd/MMM/yyyy"数据格式,但kendo网格显示归档日期必须是日期"错误.你能告诉我该怎么做吗

kendo inline cell edit not support for datetime format. I need "dd/MMM/yyyy" data format but kendo grid shows "the filed date must be a date" error. can you please advice me to what to do

推荐答案

您可以使用自定义编辑器执行此操作.

You can use a custom editor to do this.

参考文献:

  • Grid Custom Editing
  • DatePicker.format
  • Date Formatting

代码看起来像这样(未经测试,但应该足够接近才能给出正确的想法):

The code would look something like this (not tested, but it should be close enough to give you the right idea):

var customDateEditor = function (container, options) {
    $('<input />')
        .appendTo(container)
        .kendoDatePicker({
            format: "dd/MMM/yyyy"
        });
};

$("#grid").kendoGrid({
    ...
    columns:[
        {
            field: "myDate",
            format: "dd/MMM/yyyy",
            editor: customDateEditor
        }
    ]
});

这篇关于使用Datetime DatePickerFor进行Kendo Grid内联编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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