为 Kendo UI Grid 设置默认过滤器 [英] Set default filter for Kendo UI Grid

查看:41
本文介绍了为 Kendo UI Grid 设置默认过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 javaScript 呈现的 Kendo UI 网格.我希望字符串列有一个选项(包含")并且没有第二个过滤器.到目前为止一切顺利,我写道

I have a Kendo UI grid that is rendered with javaScript. I want the string columns to have a single option ("Contains") and without the second filter. So far so good, I wrote

        $("#MyGrid").kendoGrid({
            // other bits of configuration here
            filterable: {
                extra:false, 
                operators: {
                    string:{ contains: "Contains"}
                }
            },
            // more bits of configuration here
        });

作为网格定义的一部分.结果看起来不错(我只有一个选项,所以下拉是多余的).

As part of the definition of the grid. And the result looks good-ish (I only have one option, so the drop down is redundant).

然而,无论如何,过滤器仍然执行等于操作而不是包含操作(这是它唯一可用的操作).

However, regardless of this, the filter still performs the equals operation rather than the contains operation (which is the only one available to it).

我花了一段时间试图弄清楚这一点,但我一直在兜圈子,因为我发现的代码要么不起作用,要么没有意义,或者两者兼而有之.

I've spent a while trying to figure this out and I keep going around in circles because the code I found either does not work, or doesn't make sense, or both.

谁能告诉我如何将过滤器默认为包含"而不是等于"?

Can anyone tell me how to default the filter to "Contains" and not "Is Equal To"?

推荐答案

尝试更新到最新的内部版本.2012.3.1304 之后的版本应该包含修复.

Try to update to latest internal build. Version later than 2012.3.1304 should contain the fix.

这篇关于为 Kendo UI Grid 设置默认过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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