Kendo 网格日期过滤器本地化
Kendo grid date filter localization
我在一小时或更长时间后尝试更改日期列过滤器类型语言的本地化。而我不能。
这是我的:
在我的 _Layout 上:kendo.culture("fr-FR");
当我加载页面时(在应用程序的任何位置):
但在过滤器组合中:
发生了什么,我错过了什么?
编辑:
我忘了说只有日期过滤器有这个问题,字符串和数字过滤器是正确的。
您需要加载 Kendo 消息脚本文件的法语版本:
<script src="https://kendo.cdn.telerik.com/2017.2.504/js/messages/kendo.messages.fr-FR.min.js"></script>
编辑
Dojo 更新为 date example。
注意:日期过滤器选项也使用指定的语言。
找到了!
我不明白这里到底是什么问题...
我加载了良好的文化文件,数字和字符串过滤器都可以,但日期不行。
但是在 kendo 设置中我有很好的所以...
$(document).ready(function () {
$(".k-grid").each(function () {
var grid = $(this).data("kendoGrid");
if (grid) {
grid.bind("filterMenuInit", onFilterMenuInit);
}
});
});
function onFilterMenuInit(e) {
if (this.dataSource.options.schema.model.fields[e.field].type === 'date') {
var filters = new Array();
var raw = kendo.ui.FilterMenu.prototype.options.operators.date;
for (var property in raw) {
if (raw.hasOwnProperty(property)) {
filters.push({ value: property, text: raw[property] });
}
}
e.container.find("select:eq(0)").data("kendoDropDownList").dataSource.data(filters);
}
}
我在一小时或更长时间后尝试更改日期列过滤器类型语言的本地化。而我不能。
这是我的:
在我的 _Layout 上:kendo.culture("fr-FR");
当我加载页面时(在应用程序的任何位置):
但在过滤器组合中:
发生了什么,我错过了什么?
编辑:
我忘了说只有日期过滤器有这个问题,字符串和数字过滤器是正确的。
您需要加载 Kendo 消息脚本文件的法语版本:
<script src="https://kendo.cdn.telerik.com/2017.2.504/js/messages/kendo.messages.fr-FR.min.js"></script>
编辑
Dojo 更新为 date example。
注意:日期过滤器选项也使用指定的语言。
找到了!
我不明白这里到底是什么问题... 我加载了良好的文化文件,数字和字符串过滤器都可以,但日期不行。
但是在 kendo 设置中我有很好的所以...
$(document).ready(function () {
$(".k-grid").each(function () {
var grid = $(this).data("kendoGrid");
if (grid) {
grid.bind("filterMenuInit", onFilterMenuInit);
}
});
});
function onFilterMenuInit(e) {
if (this.dataSource.options.schema.model.fields[e.field].type === 'date') {
var filters = new Array();
var raw = kendo.ui.FilterMenu.prototype.options.operators.date;
for (var property in raw) {
if (raw.hasOwnProperty(property)) {
filters.push({ value: property, text: raw[property] });
}
}
e.container.find("select:eq(0)").data("kendoDropDownList").dataSource.data(filters);
}
}