Hi,
I am currently working on a feature that allows people to page and filter search results down based on search criteria entered.
To accomplish this I am calling a function called "RefreshSearchR esults" during keyup, click, and change events (for textboxes, checkboxes and select elements). This method uses Ajax to request new search results based on what was provided by the user (whether that be paging or search criteria restrictions).
Sometimes, depending on the data set involved, the server process is slower than the ajax requests which ends up making the search results appear as if they are "locked up" in my browser.
For example, if I start filtering
If the results didn't return from the "f" and I do a bunch of things that cause ajax requests, my search results section of the page appear as if they are always updating (because I'm showing a "loading" message over them) since the number of requests is taking a while to process.
I was thinking of implementing a solution that prevents ajax requests from being sent if one is already in progress....and if there were any changes between the start of the ajax request to when it finished I would start a new request.
But, I'm not sure if this is the best approach and was hoping to hear back from the JavaScript experts about the best techniques to use to avoid UI lockup like I'm experiencing.
Thanks,
-Frinny
I am currently working on a feature that allows people to page and filter search results down based on search criteria entered.
To accomplish this I am calling a function called "RefreshSearchR esults" during keyup, click, and change events (for textboxes, checkboxes and select elements). This method uses Ajax to request new search results based on what was provided by the user (whether that be paging or search criteria restrictions).
Sometimes, depending on the data set involved, the server process is slower than the ajax requests which ends up making the search results appear as if they are "locked up" in my browser.
For example, if I start filtering
student
objects based name and start typing "frinny" an ajax request is sent up to filter on "f" then "fr" then "frin" etc.If the results didn't return from the "f" and I do a bunch of things that cause ajax requests, my search results section of the page appear as if they are always updating (because I'm showing a "loading" message over them) since the number of requests is taking a while to process.
I was thinking of implementing a solution that prevents ajax requests from being sent if one is already in progress....and if there were any changes between the start of the ajax request to when it finished I would start a new request.
But, I'm not sure if this is the best approach and was hoping to hear back from the JavaScript experts about the best techniques to use to avoid UI lockup like I'm experiencing.
Thanks,
-Frinny
Comment