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

Autocomplete data-role...and Focusout

3 Answers 194 Views
MVVM
This is a migrated thread and some comments may be shown as answers.
tram
Top achievements
Rank 1
Veteran
tram asked on 05 Feb 2021, 02:38 PM

Hi All,

I am new to Kendo, can you please help me with the below scenario.

In the current scenario, when I enter 3 letters, the call is going to the database, but I want to call database only when I focus out of the textbox , I don't want to call database after 3 letters. how to achieve this, below is my code block.

 

(function ($, kendo, undefined) {
var templates = {
description:
'<input data-role="autocomplete" type="text" data-text-field="description" data-filter="contains" data-min-length="3" data-bind="source: colors, value: autoCompleteValue/>'
};

var seceditor = Widget.extend(
options: {
columns: [
  { 
    template: kendo.template(templates.description)
  }
]
});
ui.plugin(seceditor );
})(jQuery, window.kendo);

 

Thanks,

Tram

3 Answers, 1 is accepted

Sort by
0
tram
Top achievements
Rank 1
Veteran
answered on 07 Feb 2021, 05:10 PM

Hi All,

Can some one please help me.

Thanks,

Tram

0
Ivan Danchev
Telerik team
answered on 09 Feb 2021, 10:50 AM

Hi Tram,

The behavior you are after is not supported by the AutoComplete. The problem with it is that to prevent the request to the server from being sent when typing text you will have to prevent the filtering event. However, it is tied to showing the results in the dropdown, so preventing it and sending the request on focusout will lead to the popup not opening.

Regards,
Ivan Danchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
tram
Top achievements
Rank 1
Veteran
answered on 11 Feb 2021, 12:33 PM

Hi Ivan,

Thank You so much.

Regards,

Tram

Tags
MVVM
Asked by
tram
Top achievements
Rank 1
Veteran
Answers by
tram
Top achievements
Rank 1
Veteran
Ivan Danchev
Telerik team
Share this question
or