• Resolved AlexRayan

    (@alexrayan)


    First of all, thank you for a great plugin!
    It saved me a lot of time especially with CloudSponge integrated service.

    I wonder if there is any easy way to add a preloader on jq autocomplete?
    I looked into the js files and it doesn’t seem like there’s any class, like “ui-autocomplete-loading” in jq ui, for example, added to the autocomplete object.

    The reason to the above is that the autocomplete ajax request takes anywhere between 5 to 10 seconds on our site to show any suggestions.
    During that time to a regular user it seems like nothing’s happening.

    Any suggestions would be welcome.

    Best regards,
    Alex

    https://ww.wp.xz.cn/plugins/invite-anyone/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter AlexRayan

    (@alexrayan)

    For now, I added preloader outside of the plugin using jq typing() on input field and
    d('.autocomplete_loader').remove()
    in jquery-autocomplete.min.js in suggest call, but would be nice to have a better solution integrated so that there is no need to modify the plugin.

    Regards,
    Alex

    Plugin Author Boone Gorges

    (@boonebgorges)

    Hi AlexRayan – Thanks for the good question 🙂 Can you say more about what such preloading would look like? If your requests are taking a long time, presumably it’s because the site has many users; to preload these users into a JS object would take a huge amount of time. Or maybe by “preloader” you just mean some sort of visual indicator that an AJAX request is taking place (like a spinner)?

    Thread Starter AlexRayan

    (@alexrayan)

    Hi Boone,

    Sorry for confusion. Yes, I indeed meant a visual indicator that the ajax request is being processed. Without it it’s unclear that a suggestions list is being generated in case request takes some time to process.
    The jq ui autocomplete adds a class when the loading process is happening and removes it right after ajax is completed. Perhaps, that could be a solution here too for the future.

    Best regards,
    Alex

    Plugin Author Boone Gorges

    (@boonebgorges)

    As it happens, I’m not actually using jquery-ui autocomplete (for some reason I’m not sure of), and the library I’m using doesn’t add a ‘loading’ class. Instead of rewriting the whole thing to use jqui, I just modded the library. The fix will be in the new version of Invite Anyone. https://github.com/boonebgorges/invite-anyone/commit/9de7a6d5d22059c175ca903e3e0cf102873b2743

    Thread Starter AlexRayan

    (@alexrayan)

    Hi Boone,

    Thanks a lot for going as far as to add the preloader fix to Invite Anyone plugin!

    I appreciate it!

    Best regards,
    Alex

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Preloader on autocomplete’ is closed to new replies.