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

Autocomplete dropdown does not show up

3 Answers 398 Views
AutoComplete
This is a migrated thread and some comments may be shown as answers.
Madzie
Top achievements
Rank 1
Madzie asked on 31 Dec 2013, 11:02 AM
Hello,
Now an experience with AutoComplete control.
There is this control, which has minLength = 3, and keyup event hits server to get data that is searched for. Now if the desired lookup for data is say 39015 which gets records that has a column with this value (from DB), so what a strange thing I observe is, when i start typing each char i.e. 3..9..0.1..5 one by one - it hits the server each time - the problem is :
- If the typing is slow as in wait for each server call to get completed, it shows up the popup.
- If typing in is arbitary, like slow or fast or a mix, say 39 and then 015, it doesn't show up the popup.

Although, the data being fetched is correct for all the inputs. But issue comes up with showing up the popup.

I read it over in one the forum threads, to use SEARCH() method- so what i did is : call the search method in change event, checking if number of items returned are > 0.
It resolves the problem but but it arises another problem - I see in debugger that it calls the datasource read method until a selection from popup is made, which is a big bash to performance. Is there a way to control it or any other clean way to just open the popup once data is fetched.

ko.bindingHandlers.kendoAutoComplete.init = function (element, params) {
        ////debugger;
        var e = $(element);
var widget = e.data("kendoAutoComplete");

  widget.dataSource.bind("change", function (d) {
                //anytime the data source is updated, update the data pointer and the input
                if (d.items) {
                    data = new kendo.data.ObservableArray(d.items).toJSON();

                    //Sometimes the dropdown isn't rendered - force it to show up/ search from the populated datasource of the autocomplete
                    if (d.items.length > 0) {
                        widget.search(d.items[0].CompanyName);
                    }
                }
            });

3 Answers, 1 is accepted

Sort by
0
Madzie
Top achievements
Rank 1
answered on 31 Dec 2013, 06:40 PM
FYI, the version used are :
Kendo - 2013.3.1119
JQuery - 1.9.1
0
Accepted
Daniel
Telerik team
answered on 02 Jan 2014, 12:24 PM
Hello,

I am not able to reproduce the issue on my side. Can the problem be reproduced in our online demos? If yes, then could you share the exact steps or a screen cast. If not then could you provide a runnable sample which replicates this behavior?
As for opening the popup without making a request - it is possible to achieve this by using the popup open method:
widget.popup.open();


Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Madzie
Top achievements
Rank 1
answered on 04 Jan 2014, 10:17 PM
Sorry, its huge application that is facing this problem. But yes the other way to open a popup is good enough to work with now. Thanks.
Tags
AutoComplete
Asked by
Madzie
Top achievements
Rank 1
Answers by
Madzie
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or