OK, here's the deal. I'm implementing a JavaScript user lookup
(http://users.andassoc.com/gibbs/beerology.html is a static mockup and the
real site is at http://www.beerology.com/ars/) and I can't think of the best
way to get started. The current implementation of just a select box has
loading issues, and this JavaScript loads much mroe quickly and effectively.
Here's what I have to work with... I am using Cold Fusion 5 Enterprise,
first of all, so I can use query of queries and UDF's. I also have a the
results of a query available that grabs all users (query is in
application.cfm file since I use it a lot):

code:
----------------------------------------------------------------------------
----
<CFQUERY name="getUsers" datasource="#REQUEST.dbLoc#" dbtype="OLEDB"
provider="Microsoft.Jet.OLEDB.4.0" providerdsn="#REQUEST.dbLoc#"
username="admin" password=""> SELECT DISTINCT ArsID FROM tblUsers ORDER BY
ArsID</CFQUERY>
----------------------------------------------------------------------------
----

Again, this gives me all ArsID's. I need to build something like this:

code:
----------------------------------------------------------------------------
----
arUsers = new Array();
arUsers["#"] = new Array (".mobius", "//twitch", "_Rand_");
arUsers["A"] = new Array ("abcfob11", "abovewood", "acid_tongued_devil");
arUsers["B"] = new Array ("BA", "badblood", "Banal");
arUsers["C"] = new Array ("CAAB", "Caffeine Slug", "Calphor");
ETC...all the way to Z, and with dozens of user ID's for each letter of the
alphabet, plus some userID's that don't begin with an alpha character
----------------------------------------------------------------------------
----

There are well over 1,000 users, which has been growing steadily, so this
needs to be a reasonably efficient bit of coding, which takes looping and
running 27 queries out of the picture.

Off the top of my head, I know I can create a list out of all of the users
then go in and grab each list element that begins with each letter of the
alphabet (thus creating a new list) and use that list to build the
JavaScript array, but that would be a pretty laborious process. I'd love to
loop through somehow, but you need numeric values for the from and to
attributes of the cfloop tag. Can any CF experts out there think of a more
elegant approach to this problem?

Thanks

Pete

______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to