Ejemplo n.º 1
0
		/// <summary>
		/// Renders the list of SelectMenuItems to the string builder.  
		/// Note: For the SelectMenu this only happens for the root (i.e. this isn't recursive like the Menu control)
		/// </summary>
		/// <param name="sb">StringBuilder</param>
		protected internal void RenderChildren(jStringBuilder sb) {
			// Open list/item
			if (!_IsRoot)
				sb.AppendTabsFormat("<{0}>", CHILD_TAG);

			foreach (SelectMenuItemBase mi in this.Children._SelectMenuItems) {
				mi.BuildTagHtml(sb);
			}

			// Close list/item
			if (!_IsRoot)
				sb.AppendTabsFormatLineIf("</{0}>", CHILD_TAG);
		}
Ejemplo n.º 2
0
		private void RenderRootCloseItem(jStringBuilder sb) {
			sb.AppendTabsFormat("</{0}>", PARENT_TAG);
		}
Ejemplo n.º 3
0
		private void RenderOpenItem(jStringBuilder sb) {
			bool renderCss = this.SelectMenu.Rendering.RenderCSS;

			sb.AppendTabsFormat("<{0}", this.Tag);

			this.RenderAttributes(sb);
			
			if (this.Selected) {
				sb.Append(" selected=\"selected\"");
			}

			if (!string.IsNullOrEmpty(this.Value)) {
				sb.AppendFormat(" value=\"{0}\"", this.Value);
			}

			sb.Append(">");
			sb.Append(this.Title);
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Renders the list of MenuItems to the string builder.  
		/// </summary>
		/// <param name="sb">StringBuilder</param>
		protected internal void RenderChildren(jStringBuilder sb) {
			// Open list/item
			if (!_IsRoot)
				sb.AppendTabsFormat("<{0}>", this.Menu.Options.Menus);

			foreach (MenuItem mi in this.Children._MenuItems) {
				mi.BuildTagHtml(sb);
			}

			// Close list/item
			if (!_IsRoot)
				sb.AppendTabsFormatLineIf("</{0}>", this.Menu.Options.Menus);
		}
Ejemplo n.º 5
0
		} // BuildTagHtml
		
		private void RenderRootOpenItem(jStringBuilder sb) {
			sb.AppendTabsFormat("<{0}", PARENT_TAG);
			this.SelectMenu.RenderAttributes(sb);
			sb.AppendLineIf(">");
		}
Ejemplo n.º 6
0
		private void RenderOpenItem(jStringBuilder sb) {
			bool renderCss = this.Menu.Rendering.RenderCSS;

			sb.AppendTabsFormat("<{0}", this.Tag);

			if (this.IsDivider) {
				if (renderCss)
					this.AddCssClass("ui-widget-content ui-menu-divider");
				this.RenderAttributes(sb);
				sb.Append(">");
				return;
			}

			if (renderCss) 
				this.AddCssClass("ui-menu-item");
			
			if (this.IsDisabled)
				this.AddCssClass("ui-state-disabled");
			
			this.RenderAttributes(sb);

			sb.Append(">");
			if (!string.IsNullOrEmpty(this.Html)) 
				sb.Append(this.Html);
			else {
				if (!string.IsNullOrEmpty(this.TargetURL))
					sb.AppendFormat("<a href=\"{0}\"", this.TargetURL);
				else 
					sb.AppendFormat("<a href=\"#\"");
				
				if (renderCss)
					sb.Append(" class=\"ui-corner-all\"");

				sb.Append(">");
			
				if (!string.IsNullOrEmpty(this.Icon)) {
					sb.AppendFormat("<span class=\"ui-icon {0}\"></span>", this.Icon);
				}
				// Title is mandatory when not using the HTML version
				sb.Append(this.Title);
				sb.Append("</a>");
			}			
		}
Ejemplo n.º 7
0
		private void RenderRootCloseItem(jStringBuilder sb) {
			sb.AppendTabsFormat("</{0}>", this.Menu.Options.Menus);
		}
Ejemplo n.º 8
0
		} // BuildTagHtml
		
		private void RenderRootOpenItem(jStringBuilder sb) {
			sb.AppendTabsFormat("<{0}", this.Menu.Options.Menus);
			this.Menu.RenderAttributes(sb);
			sb.AppendLineIf(">");
		}
Ejemplo n.º 9
0
		private void RenderOpenItem(jStringBuilder sb) {
			sb.AppendTabsFormat("<{0}>", this.Tag);

			if (!string.IsNullOrEmpty(this.Html)) 
				sb.Append(this.Html);
			else {
				if (!string.IsNullOrEmpty(this.TargetURL))
					sb.AppendFormat("<a href=\"{0}\">", this.TargetURL);
				else 
					sb.AppendFormat("<a href=\"#\">");
			
				if (!string.IsNullOrEmpty(this.Icon)) {
					sb.AppendFormat("<span class=\"ui-icon {0}\"></span>", this.Icon);
				}
				// Title is mandatory when not using the HTML version
				sb.Append(this.Title);
				sb.Append("</a>");
			}			
		}
Ejemplo n.º 10
0
		private void RenderRootOpenItem(jStringBuilder sb) {
			sb.AppendTabsFormat("<{0}", PARENT_TAG);
			if (!string.IsNullOrEmpty(this.Label)) {
				sb.AppendFormat(" {0}=\"{1}\"", 
					LABEL_TAG, 
					HttpUtility.HtmlAttributeEncode(this.Label)
				);
			}
			if (this.IsDisabled) {
				sb.Append(" disabled=\"disabled\"");
			}
			this.RenderAttributes(sb);
			sb.Append(">");
		}