This topic contains 1 reply, has 2 voices, and was last updated by  Christopher 7 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • jqxInput with autocomplete slow #87358

    Franco01
    Participant

    I use MVC with jqxInput autocomplete, and It takes 3-4 s to load it.
    The GetKoltseghely action is load very fast, the problem is in the client side.
    Here is my code:

    var sourceKoltseghely =
        {
            datatype: "json",
            datafields: [
            {
                name: 'KoltseghelyKod'
            }
            ],
            url: "/Koltseghely/GetKoltseghely"
        };
    var dataAdapterKoltseghely = new $.jqx.dataAdapter(sourceKoltseghely);
    
    function setAutoCompleteKoltseghely(id) {
        $(id)
            .jqxInput({
                height: 25,
                source: dataAdapterKoltseghely,
                width: 200,
                displayMember: "KoltseghelyKod",
                valueMember: "KoltseghelyKod",
                minLength: 1
            });
    }
    

    I would like to reuse this control more than once, so I give the control id paramter to the setAutoCompleteKoltseghely function.
    Is there any way that the dataAdapterKoltseghely call only once the GetKoltseghely action?

    jqxInput with autocomplete slow #87374

    Christopher
    Participant

    Hi ,

    You can utilize the “loadComplete” function of the jqxDataAdapter and store the retreived data from the server in a global variable of type array and then pass it to the jqxInput(as a source). The “loadComplete” function is called after the source has been loaded successfully. That way you can minimize the server calls to only one. Here is an example usage of the loadComplete function:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxdataadapter/bindingtojsonp.htm?web

    I can’t see where and when you call the “setAutoCompleteKoltsenghrly()” function, but keep in mind that you need to call it after the data has been loaded to the global variable that you’re going to set as a source to the jqxInput or the code will throw an exception.

    Best Regards,
    Christopher

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.