根据某些值隐藏Kendo UI组合框选项 [英] Hide Kendo UI Combobox options based on certain values

查看:117
本文介绍了根据某些值隐藏Kendo UI组合框选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个kendo UI组合框,该组合框具有以下值:用户1,用户2,用户3和用户4,并且我将隐藏用户1和用户2,仅根据特定条件显示用户3和用户4.这是 Dojo .请让我知道如何实现上述目标.

I have a kendo UI combobox that has values: User 1, User 2, User 3 and User 4 and I would to hide User 1 and User 2 and only show User 3 and User 4 based on a certain condition. Here is the Dojo for that. Kindly let me know how I can achieve the above.

干杯.

推荐答案

您可以使用:

var _flt = { logic: "or", filters: [] };
// Show only User 3 and User 4
var users = $("#users").data("kendoComboBox");

_flt.filters.push({ field: 'value', operator: "contains", value: "2" });
_flt.filters.push({ field: 'value', operator: "contains", value: "3" });

$('#users').kendoComboBox().data('kendoComboBox').dataSource.filter(_flt);

这篇关于根据某些值隐藏Kendo UI组合框选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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