Example #1
0
		/// <summary>
		/// Renders the panel header and returns the HTML
		/// </summary>
		/// <returns></returns>
		internal string GetTagHtml() {
			Accordion ac = this.OnPanel.OnAccordion;
			bool prettyRender = ac.Rendering.PrettyRender;
			bool renderCss = ac.Rendering.RenderCSS;
			int tabDepth = ac.Rendering.TabDepth;
			jStringBuilder sb = new jStringBuilder(prettyRender, tabDepth + 1); 

			// H3 tag (or whatever if it's been overridden in the options)
			sb.AppendLineIf();
			sb.AppendTabsFormatIf("<{0}", ac.Options.HeadingTag);
			
			if (renderCss) {
				base.WithCss("ui-accordion-header ui-helper-reset ui-state-default");

				if (this.OnPanel.IsActive) 
					base.WithCss("ui-state-active ui-corner-top");
				else 
					base.WithCss("ui-corner-all");
			}

			// add in any attributes the user has added
			base.RenderAttributes(sb);

			// and close off the starting H3 tag
			sb.Append(">");

			sb.Append(this.OnPanel.Title);

			// Closing heading (H3)
			sb.AppendFormatLineIf("</{0}>", ac.Options.HeadingTag);

			return sb.ToString();
		}