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

查看:201
本文介绍了设置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).

但是,无论如何,过滤器仍然执行equals操作而不是包含操作(这是唯一可用的)。

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天全站免登陆