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

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

问题描述

kendo 内联单元格编辑不支持日期时间格式.我需要dd/MMM/yyyy"数据格式,但剑道网格显示提交的日期必须是日期"错误.你能建议我做什么吗

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.

参考文献:

代码看起来像这样(未经测试,但它应该足够接近以提供正确的想法):

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天全站免登陆