Feb 5, 2012 at 9:31 PM
Edited Feb 5, 2012 at 9:45 PM
I am a big fan of your jQuery scripts :).
So, I have been using your "SPAutocomplete" a lot and I realized that for every keystroke it makes a web service call with the new filter value.
My suggestions is, once it pulls the records for the first time, all subsequent filters (key-strokes) are technically going to be a subset of your original result-set, so why not just store the original result-set at client side and keep applying the subsequent
filters on it as the user types more and more characters? :)
I have already implemented it and it's working great (in my opinion :)). Of course it will eat up a little more RAM on the client machine but I think the performance boost is surely worth the price, plus client machines are getting more and more powerful
(CPU+RAM) every day, aren't they? :).
I make web service call only when the # of chars in the textbox are equal to the numChars value. That way if the person removes the whole filter and starts all over again, it should NOT apply the filter on the previous result-set :).
There is one more thing I would like to add to it...
It makes w/s calls even if you press the arrow keys :). I think we should check the ASCII of the key pressed to skip all unwanted w/s calls, what say? :)
What do you think about these? Do you wish to implement any/both of these in your next release? :) :)