Dynamic Alphabetical Navigation

Question :

Dynamic Alphabetical Navigation,

Answer :

I’m using ColdFusion to return a result set from a SQL database and turn it into a list.

I need some way to generate an alphabetical navigation bar for that list. I have ColdFusion and the jQuery library available.

I’m looking to generate something like this:

A | B | C | ...        - A  - A  - B  - B  - B  - C  - D  

Where clicking on one of the letters drops you down the page to the first item for that letter. Not all 26 letters of the alphabet are necessarily in use.

,

To generate the navigation bar, you could do something like this:

        #chr(i)#      |      

(CFLOOP doesn’t work on characters, so you have to convert to ascii codes and back.)

Read More  Windows Forms Threading and Events – ListBox updates promptly but progressbar experiences huge delay

To display the items in your query you could do something like this.

          

#ucase(left(data.name, 1))#

#name#

That’s the answer Dynamic Alphabetical Navigation, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you