This is a migrated thread and some comments may be shown as answers.

Reset the filtered List of Combobox

1 Answer 157 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Helga
Top achievements
Rank 1
Helga asked on 30 Oct 2013, 11:02 AM
Hello,
if i have the filter-option "contains" and type my searchstring in the combobox, all is ok and my item is set correct.
but now, if i set the value by sourcecode with "value()", the item will not be selected, because the filter is active and the
item is not found in the filtered list. if i click on the dropdownarrow or erase it with delete-button, all items are there and values-elect is working.

how can i delete the last filtering or refresh the combobox? the datasource has not changed.
thanks for help :)

Edit:

here is a jsfiddle example (http://jsfiddle.net/yzBdn/3/)
just type "2" in the combobox, choose the item, then type 3 in the input and leave the input (f. ex. TAB) --> the item can not be found. the filtered list doesn't contain the item with the id "3". if you open the dropdown with the cursor, all elements were listed.

i've tested:
var $elem = e.container.find("#Combobox").data("kendoComboBox"); // the Combobox in in a Grid (inline Editing)
$elem.value("");
$elem.text("");
$elem.dataSource.read();

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 30 Oct 2013, 03:36 PM
Hi Helga,

Thank you for the jsFiddle example.
In order to get this working you have to clear the currently applied filter through the filter method of the DataSource:
$('#customer_id').focusout(function () {
    var $elem = $("#customer").data("kendoComboBox");
    $elem.dataSource.filter([]); //reset filters
    $elem.value($(this).val());
});


Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ComboBox
Asked by
Helga
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or