简体   繁体   English

Kendo UI Angular 2网格上的日期过滤器

[英]Date filter on Kendo UI Angular 2 Grid

I am using the kendo-grid from the Kendo UI Angular 2 library. 我正在使用Kendo UI Angular 2库中的kendo-grid I would like to know if and how I can set a date filter - equivalent to the boolean and numeric values on the filter attribute below: 我想知道是否以及如何设置日期过滤器-等效于以下filter属性上的booleannumeric

<kendo-grid-column field="UnitPrice" filter="numeric">
</kendo-grid-column>
<kendo-grid-column field="Discontinued" filter="boolean">
</kendo-grid-column>

Many thanks. 非常感谢。

Update as of 11th April 2017 截至2017年4月11日更新

From Telerik: 从Telerik:

"Currently there is not built-in date filter, as the DateInput component was not ready when the filter row functionality has been released. That said we will add such filter in some of the following releases" “当前没有内置的日期过滤器,因为在释放过滤器行功能时DateInput组件尚未准备就绪。这表示我们将在以下某些版本中添加此类过滤器”

you can filter date by below syntax in kendo-grid. 您可以使用kendo-grid中的以下语法过滤日期。

<kendo-grid-column field="Bill-Date" title="Sales Date" filter="date"> </kendo-grid-column>

these is for additional : these shows filter by calendar animations. 这些是附加的:这些显示按日历动画过滤。 add browser/animation file into your module.ts 将浏览器/动画文件添加到您的module.ts中

As per my knowledge still Kendo UI not support date filter in angular-2, so you have to use custom filter. 据我所知,Kendo UI仍不支持angular-2中的日期过滤器,因此您必须使用自定义过滤器。

Create custom filter with column type and set HTML5 input type according to that. 创建具有列类型的自定义过滤器,并根据其设置HTML5输入类型。

For normal string filter for date value do not specify any filter type in column. 对于日期值的常规字符串过滤器,请不要在列中指定任何过滤器类型。

<kendo-grid-column field="DateField">
</kendo-grid-column>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM