Enable kendoAutoComplete programmatically.

1 Answer 4 Views
AutoComplete
RobMarz
Top achievements
Rank 1
Iron
RobMarz asked on 08 Nov 2025, 09:23 AM

Hi everyone.

I'm driving an interface via JavaScript for testing.

Something like this:

Open a modal:

$( "body" ).find( "button[data-bind='click:open']" ).click();

Write a value in an input field:

ele.val( "myValue" ).trigger( "change" );

Switch a tab:

$( ".nav-tabs a[href='#tab1']" ).tab( "show" );

But I can't activate "kendoAutoComplete".

With this statement:

$("#myKendoAutoComplete").val( "schu" ).trigger( "keydown" );

I can write to the input, the remote call is made, but the list of items in the suggestion doesn't appear.

Any ideas?

Thanks.


1 Answer, 1 is accepted

Sort by
0
Accepted
RobMarz
Top achievements
Rank 1
Iron
answered on 08 Nov 2025, 10:36 AM
I solved it like this.
I'm writing this because it might be useful to others.

 

        // interaction with suggest
        var term = "schu";
        var fruitSuggest = $("#suggest");

        // 1. Set the value
        fruitSuggest.val( term );
        var autocomplete = fruitSuggest.data( "kendoAutoComplete" );

        // 2. Invoke the search() method by widget Kendo
        autocomplete.search( term );

        // 3. select the first element
        autocomplete.list.find( "li:first" ).click();

Tags
AutoComplete
Asked by
RobMarz
Top achievements
Rank 1
Iron
Answers by
RobMarz
Top achievements
Rank 1
Iron
Share this question
or