Kendo网格-自定义过滤器行 [英] Kendo Grid - Customize Filter Row

查看:73
本文介绍了Kendo网格-自定义过滤器行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Kendo Grid中有一个称为过滤器行"的功能

there is a feature called "Filter Row" in Kendo Grid

http://demos.telerik.com/kendo-ui/grid/过滤行

我想向过滤器框添加一个下拉列表,而不是文本框或数字框.用于过滤具有国家/地区的列.所以我想在下拉列表中选择国家列表.我该怎么办?

I want to add a drop-down list instead of a text box or a number box, to the filter box. It's for filtering a column that has countries. So I want list of countries in a drop-down list. How can I do this?

推荐答案

它与自定义过滤器菜单(

It's very similar to the custom Filter Menu (http://demos.telerik.com/kendo-ui/grid/filter-menu-customization). I made the mistake of no using valuePrimitive: true. You might not want it in your situation but keep that in mind.

以下是示例: http://dojo.telerik.com/OKaS

此外,过滤器菜单应占据列的编辑器模型,但这并不总是您想要的.

Also, the filter menu should take up the editor model of the column but it's not always what you want.

修改

从2014年第二季度SP1开始,模板函数现在接收包含数据源"和元素"的对象.在我的示例中,您必须将下拉列表初始化从"container.kendoDropDownList"更改为"container.element.kendoDropDownList".在我的示例中,数据源为空,但是我假设这可用于将选择传递给控件,​​而无需其他数据源或外部化当前数据.我尚未尝试使用此功能,但建议您在盲目取样之前先做一下.

Starting from 2014 Q2 SP1, the template function now receives an object containing "datasource" and "element". In my example, you would have to change the dropdown initialization from "container.kendoDropDownList" to "container.element.kendoDropDownList". The datasource is empty in my example but I'm assuming this can be used to pass the choices to a control without requiring another datasource or to externalize your current. I have not experimented with this feature but I suggest you do before taking my sample blindly.

这篇关于Kendo网格-自定义过滤器行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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