protected virtual void WriteItem(HtmlTextWriter writer, t_row row, int level) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "qgContent"); writer.RenderBeginTag(HtmlTextWriterTag.Div); if(row.link) { string link = FormatLink("quickgroup", row); writer.AddAttribute(HtmlTextWriterAttribute.Href, link); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.Write(row.name); writer.RenderEndTag(); } else { writer.Write(row.name); } writer.RenderEndTag(); }
protected virtual void WriteTreeNode(HtmlTextWriter writer, t_row row, int level, bool isLast) { //<li class="qgNode '.($childrens == 0 ? 'qgExpandLeaf' : 'qgExpandClosed').($last ? ' qgIsLast' : '').'"> //<div class="qgExpand"></div> writer.AddAttribute(HtmlTextWriterAttribute.Class, String.Format("qgNode {0}{1}", (row.row != null && row.row.Length > 0) ? "qgExpandClosed" : "qgExpandLeaf", isLast ? " qgIsLast" : null)); writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Class, "qgExpand"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); WriteItem(writer, row, level); if (row.row != null && row.row.Length > 0) { //<ul class="qgContainer">'.$subhtml.'</ul> writer.AddAttribute(HtmlTextWriterAttribute.Class, "qgContainer"); writer.RenderBeginTag(HtmlTextWriterTag.Ul); for (int i = 0; i < row.row.Length; i++) { WriteTreeNode(writer, row.row[i], level + 1, (i + 1) == row.row.Length); } writer.RenderEndTag(); } //</li> writer.RenderEndTag(); }