Create and setup a new menu. | Create a menu from existing sql server 2000 table(s). |
The following builder gives you the ability to write your own SQL Queries and define as many levels to your menu as you wish. The default data below is running off of my home desktop computer that is connected to the PUBS database to generate a menu. My PC is not a server, the performance issues is not a good representation of the actual speed as if this app was set up in a client server environment. Step 1: Place this page (menubuilder.htm), getmenu.asp, and menu.js in a virtual directory you have set up on your machine. Please set the connection string in getmenu.asp to your database. Step 2: Fill out the values representing the menu params you wish to use.
Step 3: Generate the sql queries below needed to obtain the data need to build the menu. The following is a list of rules that need to be followed: Rules: Pubs Database Example below running off of my home pc. Performance is not a good representation if set up in a real client server environment.
Step: 4 After completing the menu creation step above, now install the menu into your production page. In your virtual directory, copy getmenu.asp, menu.js, and your webpage you wish your menu to appear. Step: 5 In your web page, place the menu.js. i.e. <SCRIPT LANGUAGE=javascript src="menu.js"></SCRIPT> Step: 6 Copy the below function into your web page. Call the function in an event such as a click or mouseover. Change the first parameter to the object you wish to attach. See example link below for a working example. View example page Notes: |
Table with a one to many relationship between the Primary/Unique Key and the Foreign Key. This type of table creates a natural casading menu the can cascade any number of levels.
Step 1: Setup stored proc needed to access data. Cut and paste the SQL script below into SQL Query Analyzer and execute the script. Execute the script in the the database you wish to access your menu data. This will create a stored proc named cascadeMenuExisting. Step 2: Place this page, getmenu.asp, and menu.js in your virtual directory. Set the options below and test your menu to get the desired results. Be sure the connection string, and all the table parameters are set properly, if not you will not be able to connect with your database. You will get the connection error if any of your table variables used to access the database table are set wrong. Also the string expression representing the javascript onclick action must be set correctly, if not you will also get the connection error message. The following is default values below are set for a table named menu_tbl with a foreign key named parent_fld and a primary key named prim_fld. Other fields in the table are used to set the folder and onclick values. This table runs off runs off of my home PC. Please excuse the speed issues, my PC is no where near the performance to a server.
Step 3: Now that you have created your menu as in the previous step, you may proceed to place the menu into your web page. Attach menu.js to your web page. Make sure menu.js exists in your directory. i.e. <SCRIPT LANGUAGE=javascript src="menu.js"></SCRIPT> Step 4: Place getmenu.asp in your website directory. Step 5: Copy the below function to your web page. Change the first parameter to the object you wish to attach. Call the function in some event, such as mouseover or onclick. See the example page link below to see an example on how this page is setup. |
|
|
|