2

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.

Cheers.

Neophile
  • 5,660
  • 14
  • 61
  • 107

1 Answers1

3

You could use:

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);