Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Kendo DateTimePicker从本地存储读取后没有时钟_Javascript_C#_Kendo Ui_Local Storage_Kendo Asp.net Mvc - Fatal编程技术网

Javascript Kendo DateTimePicker从本地存储读取后没有时钟

Javascript Kendo DateTimePicker从本地存储读取后没有时钟,javascript,c#,kendo-ui,local-storage,kendo-asp.net-mvc,Javascript,C#,Kendo Ui,Local Storage,Kendo Asp.net Mvc,场景 在我的剑道格网中,我有日期时间选择器。接下来,我将日期时间选择器保存在本地存储器中。当我再次进入我的页面时。只有日期选择器(没有时钟)。 我是剑道初学者。这不是我的代码,所以我不确定它是否是全部 代码 columns.Bound(p => p.CreateDate) .HeaderHtmlAttributes(headerHtmlAttributes) .Filterable(true)

场景 在我的剑道格网中,我有日期时间选择器。接下来,我将日期时间选择器保存在本地存储器中。当我再次进入我的页面时。只有日期选择器(没有时钟)。 我是剑道初学者。这不是我的代码,所以我不确定它是否是全部

代码

columns.Bound(p => p.CreateDate)
                    .HeaderHtmlAttributes(headerHtmlAttributes)
                    .Filterable(true)
                    .Format("{0:yyyy-MM-dd HH:mm:ss}").Filterable(f => f.UI("DateTimeFilter"));
和过滤函数

function DateTimeFilter(control) {
    $(control).kendoDateTimePicker({
        format: "yyyy-MM-dd HH:mm:ss",
        timeFormat: "HH:mm:ss"
    });
}
保存功能

    var saveGridOptions = function (eventFromGrid) {
    var grid = eventFromGrid.sender,
        gridId = $(grid.wrapper).attr('id');

    localStorage[gridId + gridStorageSuffix] = kendo.stringify(grid.getOptions());
};
在cshtml文件中创建网格时也有代码:

.Events(ev =>
{
    ev.DataBound("GridHelper.saveGridOptions");
    ev.ColumnResize("GridHelper.saveGridOptions");
    ev.ColumnHide("GridHelper.saveGridOptions");
    ev.ColumnShow("GridHelper.saveGridOptions");
})

当您使用KendoUIMVC包装器时,它使用标准的ASP.NETMVC方式来决定 编辑特性时要使用的编辑器模板

项目编辑器通常位于projects View/Shared/EditorTemplates文件夹中。 确保您已经包括/复制了Telerik/Kendo提供的所有编辑器模板。 (例如Integer.cshtml、Date.cshtml、DateTime.cshtml)放入此文件夹

您还可以指定手动使用哪个编辑器,例如。 1) 装饰您的视图模型属性,例如。
[UIHint(“DateTime”)]
或 2) 在网格配置中,列-行-添加
.EditorTemplateName(“日期时间”)


这将自动使用Kendo DateTime小部件。

只有当我将其保存到本地存储时,才会出现此问题。