Reputation: 2548
I have a kendo grid with filtering enabled. When trying to enhance performance I found out, that filtering triggers backend 2 times. Found out that it triggers when I press key
in column search field and also when I press Enter
.
Is there a way to turn off automatic filtering, so that user could enter filter data and perform filtering only when user approves it with Enter
?
Is there some setting to control filter automatic/on-submit behavior? I guess it might be done implementing custom filters or something like that, but that sounds like an overkill for a simple behavior..
This is how filter options are set for the grid.
filterable: {
mode: "row",
operators: {
string: {
contains: "Contains"
}
}
}
Upvotes: 0
Views: 856
Reputation: 2494
Yea, that's the autocomplete feature, sending a request for every keypress. Every keypress is fetching data from the server for populating dropdown selection.
You can avoid ti by adding class in your filter template:
filterable: {
cell: {
template: function(e){
e.element.addClass("k-textbox");
}
}
}
NOTE: filter will be triggered on Enter
and on focus-out
event.
You can start from this example: No autocomplete
Or you can use minWidth
before sending search request for populating dropdown selection:
filterable: {
cell: {
minLength: 10
}
}
Upvotes: 1