C# Class Fluqi.Widget.jMenuItem.MenuItem

A set of properties to apply to a set of jQuery UI Tab.
ファイルを表示 Open project: toepoke/Fluqi Class Usage Examples

Public Methods

Method Description
Finish ( ) : MenuItems

Ends configuration of the menu item just added and brings the fluent API back a level to allow further menu items to be added.

MenuItem ( MenuItem parent ) : System

Constructor

MenuItem ( jMenu owner, string id ) : System

Constructor

SetAsDivider ( ) : MenuItem

Sets this menu-item as a divider.

SetDisabled ( ) : MenuItem

Sets this menu item as disabled

SetIcon ( Core value ) : MenuItem

Sets the icon which appears to the left of the menu item. This is one of the built in icons provdided by the jQuery UI framework.

SetIcon ( string cssClass ) : MenuItem

Sets the icon which appears to the left of the menu title.

Use this for adding your own icon. The "ui-icon" jQuery UI class will still be added first (so you can use this for sizing), but the "ui-icon" prefix won't be added in front of your CSS class.

SetTag ( string value ) : MenuItem

Sets the LI tag to use

SetTargetURL ( string value ) : MenuItem

Sets the URL to navigate to from the menu (this replaces the default "#" href).

SetTitle ( string value ) : MenuItem

Changes the title that appears in the menu item.

Dunno why you'd want to do this after it's already been defined when adding the menu item but I'm leaving it here if only for the sake of consistency with the API.

WithAttribute ( string attrName, string attrValue ) : MenuItem

Registers an HTML attribute to be added to the control when it is rendered.

WithCss ( string cssClasses ) : MenuItem

Registers a set of CSS class names to be added to the control when it is rendered. This is in addition to jQuery UI styles that may appear (see RenderCss property).

WithID ( string idValue ) : MenuItem

Registers an ID attribute to be added to the control when it is rendered.

WithStyle ( string styleName, string styleValue ) : MenuItem

Registers an embedded style setting to be added to the control when it is rendered. These are written out as part of the "style" attribute, so we might add 'WithStyle("border", "solid 1px blue")' for example.

Protected Methods

Method Description
BuildTagHtml ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void

Builds up the Html for a menu-item

HasChildren ( ) : bool

Convenience function for eastablishing if there are any child/sub-menu items off this menu item.

RenderChildren ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void

Renders the list of MenuItems to the string builder.

Reset ( ) : void

Resets the object back to a known state.

Private Methods

Method Description
RenderCloseItem ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void
RenderOpenItem ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void
RenderRootCloseItem ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void
RenderRootOpenItem ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void

Method Details

BuildTagHtml() protected method

Builds up the Html for a menu-item
protected BuildTagHtml ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void
sb Fluqi.Extension.Helpers.jStringBuilder
return void

Finish() public method

Ends configuration of the menu item just added and brings the fluent API back a level to allow further menu items to be added.
public Finish ( ) : MenuItems
return MenuItems

HasChildren() protected method

Convenience function for eastablishing if there are any child/sub-menu items off this menu item.
protected HasChildren ( ) : bool
return bool

MenuItem() public method

Constructor
public MenuItem ( MenuItem parent ) : System
parent MenuItem MenuItem object _this_ item belongs to
return System

MenuItem() public method

Constructor
public MenuItem ( jMenu owner, string id ) : System
owner jMenu Menu object _this_ item belongs to
id string ID to assign to the MenuItem object
return System

RenderChildren() protected method

Renders the list of MenuItems to the string builder.
protected RenderChildren ( Fluqi.Extension.Helpers.jStringBuilder sb ) : void
sb Fluqi.Extension.Helpers.jStringBuilder StringBuilder
return void

Reset() protected method

Resets the object back to a known state.
protected Reset ( ) : void
return void

SetAsDivider() public method

Sets this menu-item as a divider.
public SetAsDivider ( ) : MenuItem
return MenuItem

SetDisabled() public method

Sets this menu item as disabled
public SetDisabled ( ) : MenuItem
return MenuItem

SetIcon() public method

Sets the icon which appears to the left of the menu item. This is one of the built in icons provdided by the jQuery UI framework.
public SetIcon ( Core value ) : MenuItem
value Core
return MenuItem

SetIcon() public method

Sets the icon which appears to the left of the menu title.
Use this for adding your own icon. The "ui-icon" jQuery UI class will still be added first (so you can use this for sizing), but the "ui-icon" prefix won't be added in front of your CSS class.
public SetIcon ( string cssClass ) : MenuItem
cssClass string
return MenuItem

SetTag() public method

Sets the LI tag to use
public SetTag ( string value ) : MenuItem
value string
return MenuItem

SetTargetURL() public method

Sets the URL to navigate to from the menu (this replaces the default "#" href).
public SetTargetURL ( string value ) : MenuItem
value string
return MenuItem

SetTitle() public method

Changes the title that appears in the menu item.
Dunno why you'd want to do this after it's already been defined when adding the menu item but I'm leaving it here if only for the sake of consistency with the API.
public SetTitle ( string value ) : MenuItem
value string
return MenuItem

WithAttribute() public method

Registers an HTML attribute to be added to the control when it is rendered.
public WithAttribute ( string attrName, string attrValue ) : MenuItem
attrName string Name of the HTML attribute, e.g. "Tab" or "id" for example
attrValue string Value to be applied when the attribute is rendered
return MenuItem

WithCss() public method

Registers a set of CSS class names to be added to the control when it is rendered. This is in addition to jQuery UI styles that may appear (see RenderCss property).
public WithCss ( string cssClasses ) : MenuItem
cssClasses string Set of space separated CSS class names to add
return MenuItem

WithID() public method

Registers an ID attribute to be added to the control when it is rendered.
public WithID ( string idValue ) : MenuItem
idValue string Value for the ID
return MenuItem

WithStyle() public method

Registers an embedded style setting to be added to the control when it is rendered. These are written out as part of the "style" attribute, so we might add 'WithStyle("border", "solid 1px blue")' for example.
public WithStyle ( string styleName, string styleValue ) : MenuItem
styleName string Name of the style attribute to be added
styleValue string Value of the style to be added
return MenuItem