| Page 1 of 1 | [ 3 posts ] |
|
Here is my scenario: a user selects a county (from an autocomplete textbox) and then (in another autocomplete) is able to select one of the cities in that county.
I want to pull all cities in a county and do the filtering client-side (which makes sense for my use-case). Also, I want to start loading the cities in the county autocomplete's "select" event, rather than waiting for the user to tab over to the cities textbox, to improve perceived performance. All that is working fine. Here is the issue: if a fast user enters the county, then tabs over to the city textbox and starts typing before the "pre-load" request comes back, it will issue a second one and then wait for that. I would the city autocomplete to somehow recognize that a request is already in progress. Any ideas on how to accomplish that? My code is [gist=2b9093918fd7b619b2fe]here[/gist]. TIA, Gabe |
|
Thinking from an interaction design perspective, wouldn't it make more sense to have a single input field for the city and then automatically determine the correct county based on the city the user enters?
In any case, I think the current design could be made to work by disabling city queries until the cache is primed. Here's a fork of your gist (untested, so beware) that demonstrates what I'm thinking: https://gist.github.com/ad3f4b928857600a8442 I also changed the way the city AutoComplete's requestTemplate was set. Instead of getting form values on every execution of the requestTemplate, there's now a utility function that returns a string template, and the requestTemplate value is updated when the template changes. This should be faster. |
|
Thanks Ryan, that should work.
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group