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

AutoComplete Suggest not working

3 Answers 184 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
1zias01
Top achievements
Rank 2
1zias01 asked on 04 Mar 2012, 06:52 AM
I have an AutoComplete calling an ajax-enabled WCF service using JSON.  it's works fine and I get results when I type into the Input.  However I would also like to programmatically set the input value and have results returned.  I tried to use the example below.  And it sets the input box but it's not getting data and the drop down results aren't showing up.   How do I get this to work?

Forces a suggestion onto the text of the AutoComplete.

Example

// note that this suggest is not the same as the configuration method
// suggest which enables/disables auto suggesting for the AutoComplete
//
// get a referenence to the Kendo UI AutoComplete
var autoComplete = $("#autoComplete").data("kendoAutoComplete");

// force a suggestion to the item with the name "Inception"
autoComplete
.suggest("Inception");

3 Answers, 1 is accepted

Sort by
0
1zias01
Top achievements
Rank 2
answered on 05 Mar 2012, 06:30 PM
Anyone alive out there?!
0
Georgi Krustev
Telerik team
answered on 06 Mar 2012, 10:55 AM
Hi Chris,

 I believe that you need to use the search method to filter the DataSource. Check this help topic for more information.

Regards,
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!
0
1zias01
Top achievements
Rank 2
answered on 07 Mar 2012, 02:41 AM
Whoops spoke too soon.

Looks like I have to call both like so:

var autoComplete = $("#autoComplete").data("kendoAutoComplete");

// force a suggestion to the item with the name "Inception"
autoComplete
.suggest("Inception");
autoComplete.search("Inception");

That did it.  What a relief.


Thanks
Tags
AutoComplete
Asked by
1zias01
Top achievements
Rank 2
Answers by
1zias01
Top achievements
Rank 2
Georgi Krustev
Telerik team
Share this question
or