简体   繁体   English

Kendo jQuery Grid,在下拉过滤器上获取文本

[英]Kendo jQuery Grid , Get text on dropdown filter

How can i get the text field of a dropdown in the column filter?如何获取列过滤器中下拉列表的文本字段?

I have the following example : https://dojo.telerik.com/izUviSID/2我有以下示例: https : //dojo.telerik.com/izUviSID/2

You can check the filters like so:您可以像这样检查过滤器:

    function checkFilters() {
       let myGrid = $("#grid").data("kendoGrid");
       let filter = myGrid.dataSource.filter();
       if (filter) {
          console.log(filter.logic);
          console.log(myGrid.dataSource.filter);
       }
    }

I added this to your dojo too: https://dojo.telerik.com/izUviSID/3我也将此添加到您的道场: https : //dojo.telerik.com/izUviSID/3

You can also check individual filters if they exist like so:您还可以检查单个过滤器是否存在,如下所示:

filter.filters[0]

The way you have your filters set up though, there is no text value for the filters.但是,您设置过滤器的方式,过滤器没有文本值。 Find out more info in the Kendo demos/docs https://demos.telerik.com/kendo-ui/grid/filter-menu-customization在 Kendo 演示/文档https://demos.telerik.com/kendo-ui/grid/filter-menu-customization 中了解更多信息

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

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