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

how to clear autocomplete

3 Answers 1149 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 02 Apr 2012, 01:05 PM
There is probably something I'm missing here, but I can't find a way to clear the autocomplete and have it refresh the datasource.  I have tried making a button with a click event that does it, but I'm not sure what to put in the click event.  Here is a jsfiddle.  Would you please show me how to clear the search result and refresh the grid to bring it back to all results?

http://jsfiddle.net/dsapala/5f3x4/

3 Answers, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 02 Apr 2012, 06:50 PM
There is another thread in this same forum (http://www.kendoui.com/forums/ui/autocomplete/turn-off-on-stop-and-start-autocomplete-and-suggest-after-init.aspx) that seems to apply to the same topic and may be useful to you. It worked for me. I have had the same problem in the past, but I think I have rectified my problem using the solutions presented in that thread. Good luck!
_______________________
medigap quotes
medicare supplement plan
0
Dan
Top achievements
Rank 1
answered on 02 Apr 2012, 07:38 PM
I really appreciate the answer, but I'm not sure how that solves the problem.  That code just turns the autocomplete off and on.

I might not have been clear enough.  I need the autocomplete to "undo" the search that it has performed when I click the clear button.  Meaning I want the grid to display the full result set again like it does when I initially load the page.

Thank you so much for your reply.  If you know how to "reset" the autocomplete, grid and datasource back to the original "just loaded the page" state that would be what I need.
0
Georgi Krustev
Telerik team
answered on 03 Apr 2012, 06:07 AM
Hello Dan,

 
You will need to use the filter method of the DataSource. Check the updated jsFiddle demo.

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