MortenGR
MortenGR

Reputation: 833

Kendo UI Combobox doesn't trigger read when dropdown arrow is clicked

I have a Kendo UI ComboBox with serverfiltering set to true and autobind to false. I want it to behave like the following:

1) On page load doesn't load anything.

2) When the user writes some text, server filtering is performed and results are displayed.

3) When the user click dropdown, load all items regardless of filtering and display them.

The issue is that in earlier versions of KendoUI, the combobox worked like the above with the right configuration, but in newer versions, entering some text and clicking on the dropdown does not trigger a read and thus only show items matching the filter.

Reproduce

See the following example: https://dojo.telerik.com/ATEWEmuz

1) Select newest version of the Kendo UI framework at "Choose Library"

2) Click the combobox

3) Write j and wait a bit, then click outside the combobox

4) Click the dropdown arrow

Result in earlier versions vs result in current version:

enter image description here enter image description here

Is there a way to tell kendo to reload all data when I click on dropdown via configuration? I tried binding the ondown event on the arrow to a datasource read command, but that resulted in other weird behavior.

Upvotes: 0

Views: 2261

Answers (1)

Richard
Richard

Reputation: 27508

If you log the read actions

var ret = ["John", "Candice", "Scott", "Rejer"];
console.log(ret);
console.log(filter);

You will see that older libraries read with no filter during open event. The newest library does not perform a read during open.

This could be related to https://github.com/telerik/kendo-ui-core/issues/3926, or it could be the behavioral contract changed.

To revert to prior behavior you can remove the filters in the combobox blur event handler.

var kendoControl = $("#box").data("kendoComboBox");

$("#box").blur(function(e) {
  kendoControl.dataSource.filter([]);
});

Upvotes: 0

Related Questions