Function: Build Multi Drop Down
TODO: To use this control first you must set the relative path to the image
files Line:63 in "system/DropDownInc.asp"
Purpose: The purpose of this widget is:
1. provide a multi column drop down box to users
2. provide a combo box's that dont sit on the top of a
web browser for menus
can flow over the control
3. provide a combo box that can allow user input
4. provide a combo box that allows the user to begin
typing the answer IE masking
Written By: Tom Bruinsma
3/24/03
tom.bruinsma@aurumtechnology.com
Dependencies: This function is dependant on:
1. function: GetRS contained in db.asp
2. constant: DBConn contained in system.asp
Input Def:
sName:
This is the name that will be used to identify the
combo box.
Acceptable input is standard field naming conventions IE No spaces
or special Chars
bEditable:
This was entered for future use, I plan to expand the
function to allow user entry
The plan is to make this true if the user allowed free form entry.
bAutofill:
This was entered for future use. I plan to implement
autofill at some point that
will autofill the field with a value from the drop down as the user types.
sQuery:
This is a standard SQL query that will be used to
populate the drop down.
Example: Select State, StateName as State_Name from tbl_States
Note that the second field was renamed. In the results the header record
uses the field names
to populate the header record. underscores are replaced with spaces.
sSelected
This is the value that will be placed in the box by
default.
iBoundCol
This is the number of the column that is bound. IE what
field will be placed in the box when
the row is selected.
iDisplayCol
This is the number of the column that is used for Display to
the user
bHideKey
This is a boolean that determines if the Bound Column will be
omitted from the visible results ' in the drop down
iDropHeight
This is the height of the drop down div in pixels.
iDropWidth
This is the width of the drop down menu in pixels.
iTextWidth
This is the width of the text box in char's.
bHeader
This determines if the header row should be displayed.
Output:
1. A table with one row and two cells. The first cell
will contain
a text box that will be used for display and a hidden text box that count. The second field will contain a
graphic of a drop
down arrow.
2. A div containing a table of data from the sql query.
The default state is hidden. When the
drop arrow is selected a function called ShowMenu is called to
position the div below the
text box.
Sample 1:
This example shows two things, first if the drop down height is smaller then
the configured height it will auto resize the width to the size of the results.
BuildMultiDropDown("Sample1", True, True, "Select State, Name From tbl_States",
"AL", 0,1,True, 300, 200, 20, True)
 |
 |
 |
 |
Name |
 |
 |
All |
 |
 |
Alabama |
 |
 |
Alaska |
 |
 |
Arizona |
 |
 |
Arkansas |
 |
 |
California |
 |
 |
Colorado |
 |
 |
Connecticut |
 |
 |
Delaware |
 |
 |
District of Columbia |
 |
 |
Florida |
 |
 |
Georgia |
 |
 |
Hawaii |
 |
 |
Idaho |
 |
 |
Illinois |
 |
 |
Indiana |
 |
 |
Iowa |
 |
 |
Kansas |
 |
 |
Kentucky |
 |
 |
Louisiana |
 |
 |
Maine |
 |
 |
Maryland |
 |
 |
Massachusetts |
 |
 |
Michigan |
 |
 |
Minnesota |
 |
 |
Mississippi |
 |
 |
Missouri |
 |
 |
Montana |
 |
 |
Nebraska |
 |
 |
Nevada |
 |
 |
New Hampshire |
 |
 |
New Jersey |
 |
 |
New Mexico |
 |
 |
New York |
 |
 |
North Carolina |
 |
 |
North Dakota |
 |
 |
Ohio |
 |
 |
Oklahoma |
 |
 |
Oregon |
 |
 |
Pennsylvania |
 |
 |
Rhode Island |
 |
 |
South Carolina |
 |
 |
South Dakota |
 |
 |
Tennessee |
 |
 |
Texas |
 |
 |
Utah |
 |
 |
Vermont |
 |
 |
Virginia |
 |
 |
Washington |
 |
 |
West Virginia |
 |
 |
Wisconsin |
 |
 |
Wyoming |
 |
 |
 |
 |
Sample 2:
This example shows two things, first if the drop down height is smaller then
the configured height it will auto resize the height to the size of the results.
Note that the selected item is not a valid field from bound column. In this
event the selected is input into both the display text and key.
BuildMultiDropDown("Sample2", True, True, "Select '(GMT ' +[GMT_Offset] +')' as
GMT_Offset2, TimeZone as Time_Zone, GeneralLocation as General_Location From
tbl_TimeZones", "EST", 0,0,False, 300, 430, 20, False)
 |
 |
 |
 |
 |
 |
(GMT -05:00) |
Eastern Standard Time |
US & Canada |
 |
 |
(GMT -04:00) |
Atlantic Standard Time |
Canada |
 |
 |
(GMT -06:00) |
Central Standard Time |
US & Canada |
 |
 |
(GMT -07:00) |
Mountain Standard Time |
US & Canada |
 |
 |
(GMT -08:00) |
Pacific Standard Time |
US & Canada |
 |
 |
(GMT -10:00) |
Hawaiian Standard Time |
Hawaii |
 |
 |
 |
 |
 |
 |