Class DHTMLSuite.menuModel
Object
|
+--DHTMLSuite.menuModel
- class
DHTMLSuite.menuModel
Purpose of class: Organize menu items for different menu widgets. demos of menus: (Demo)
Defined in menu-for-applications.js
Author: Alf Magne Kalleland(www.dhtmlgoodies.com)
Version: 1.0
Method Summary |
Object
|
addItem(id,itemText,itemIcon,url,parentId,helpText,jsFunction,type,submenuWidth)
Add separator (special type of menu item)
|
void
|
addItemsFromMarkup(ulId)
This method creates all the menuModelItem objects by reading it from existing markup on your page.
|
Object
|
addSeparator(parentId)
Add separator (special type of menu item)
|
void
|
init()
Initilizes the menu model.
|
void
|
setMainMenuGroupWidth(newWidth)
Add separator (special type of menu item)
|
void
|
setMenuItemVisibility(id,visible)
Save visibility of a menu item.
|
void
|
setSubMenuWidth(id,newWidth)
This method specifies the width of a sub menu group.
|
menuItems
Object menuItems
menuItemsOrder
Object menuItemsOrder
submenuType
Object submenuType
DHTMLSuite.menuModel
DHTMLSuite.menuModel()
Author: Alf Magne Kalleland(www.dhtmlgoodies.com)
Version: 1.0
addItem
Object addItem(id,itemText,itemIcon,url,parentId,helpText,jsFunction,type,submenuWidth)
Add separator (special type of menu item)
Parameters:
string
- itemText = text of menu item
string
- itemIcon = file name of menu icon(in front of menu text. Path will be imagePath for the DHTMLSuite + file name)
string
- url = Url of menu item
int
- parent id of menu item
String
- jsFunction Name of javascript function to execute. It will replace the url param. The function with this name will be called and the element triggering the action will be sent as argument. Name of the element which triggered the menu action may also be sent as a second argument. That depends on the widget. The context menu is an example where the element triggering the context menu is sent as second argument to this function.
addItemsFromMarkup
void addItemsFromMarkup(ulId)
This method creates all the menuModelItem objects by reading it from existing markup on your page.
Example of HTML markup:
<ul id="menuModel">
<li id="50000" itemIcon="../images/disk.gif"><a href="#" title="Open the file menu">File</a>
<ul width="150">
<li id="500001" jsFunction="saveWork()" itemIcon="../images/disk.gif"><a href="#" title="Save your work">Save</a></li>
<li id="500002"><a href="#">Save As</a></li>
<li id="500004" itemType="separator"></li>
<li id="500003"><a href="#">Open</a></li>
</ul>
</li>
<li id="50001"><a href="#">View</a>
<ul width="130">
<li id="500011"><a href="#">Source</a></li>
<li id="500012"><a href="#">Debug info</a></li>
<li id="500013"><a href="#">Layout</a>
<ul width="150">
<li id="5000131"><a href="#">CSS</a>
<li id="5000132"><a href="#">HTML</a>
<li id="5000133"><a href="#">Javascript</a>
</ul>
</li>
</ul>
</li>
<li id="50003" itemType="separator"></li>
<li id="50002"><a href="#">Tools</a></li>
</ul>
Object addSeparator(parentId)
Add separator (special type of menu item)
Parameters:
int
- parent id of menu item
init
void init()
Initilizes the menu model. This method should be called when all items has been added to the model.
setMainMenuGroupWidth
void setMainMenuGroupWidth(newWidth)
Add separator (special type of menu item)
Parameters:
String
- newWidth = Size of a menu group
int
- parent id of menu item
setMenuItemVisibility
void setMenuItemVisibility(id,visible)
Save visibility of a menu item.
Parameters:
int
- id = Id of menu item..
Boolean
- visible = Visibility of menu item.
setSubMenuWidth
void setSubMenuWidth(id,newWidth)
This method specifies the width of a sub menu group. This is a useful method in order to get a correct width in IE6 and prior.
Parameters:
int
- id = ID of parent menu item
String
- newWidth = Width of sub menu items.
Documentation generated by
JSDoc on Mon Nov 20 09:23:50 2006