The last example on this page breaks if you attempt to open it after a filtering and removing the filter.
the filter object is undefined
https://docs.telerik.com/kendo-ui/api/javascript/ui/combobox/events/filtering
After fixing this issue I get an unresponsive combobox the first time after the combobox is cleared and it loses focus.
I would like the combobox to only filter when at least 3 letters are entered, and open each time the user clicks regardless of if there is any data.
The combobox:
<
kendo-combobox
for
=
"PersonId"
filter
=
"Kendo.Mvc.UI.FilterType.Contains"
clear-button
=
"true"
placeholder
=
"Search Name of Person"
enforce-min-length
=
"true"
datatextfield
=
"Name"
datavaluefield
=
"PrimaryId"
min-length
=
"3"
suggest
=
"true"
class
=
"w-100"
on-filtering
=
"CancelEmptyFilter"
auto-bind
=
"false"
>
<
datasource
type
=
"Kendo.Mvc.UI.DataSourceTagHelperType.Ajax"
server-paging
=
"true"
server-filtering
=
"true"
on-request-end
=
"DataSourceError"
page-size
=
"100"
>
<
transport
>
</
transport
>
</
datasource
>
</
kendo-combobox
>
The JS function:
function
CancelEmptyFilter(e) {
console.log(e);
if
(!e.filter || !e.filter.value) {
e.preventDefault();
return
;
}
}
Video Below