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

Prevent callback to data sourse on focus lost

2 Answers 206 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Cedric
Top achievements
Rank 1
Cedric asked on 14 Apr 2015, 07:41 AM
HI Telerik team.

I'm using an autocomplete component for filtering rows in a grid (on server side).

I've noticed that the component calls the server to bind to the datasource when it lost the focus, that is to say that the grid is filtered twice with the same value( when you type the last char and when the autocomplete lost its focus).

Is there a way to prevent this ?

 Thanks for your answer.

Regards,

   Cédric

2 Answers, 1 is accepted

Sort by
0
Cedric
Top achievements
Rank 1
answered on 14 Apr 2015, 01:03 PM
Forget my first question cause I'm not using the autocomplete control the way I'm supposed to do.

In fact, I would like to have an filter that acts this way:

 - A textbox with delay and minLength properties like the autocomplete control (in fact, an autocomplete without dropdown list).

 - When the user stops typing or press the tab or the enter key, act like when you select a value in the autocomplete control (reload the grid with all its filters)

 I'm near the goal passing an empty datasource to the autocomplete but I must press tab or enter key to refresh the grid and I don't find the way to refresh the grid when the user stops typing.

 Thanks for your help,

 Regards,

  Cédric
0
Georgi Krustev
Telerik team
answered on 16 Apr 2015, 06:45 AM
Hello Cedric,

I believe that the best way will be to build a custom widget that wires the DataSource component to an input element. Thus you will be able to wire the change event of the input and filter the source manually.

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