protected override void DrawTbody(SealedControl obj, HtmlNode node, PageBrush brush) { brush.DrawLine("<tbody data-name=\"dataContent\" data-proxy=\"{give:new $$.databind()}\">"); brush.DrawLine("<tr data-proxy=\"{display:'',loops:'rows'}\">"); var selectMode = node.GetAttributeValue("select", "false"); if (selectMode == "true") { brush.DrawLine("<td><input type=\"checkbox\" class=\"checkboxes\" value=\"1\" /></td>"); } var items = node.SelectNodesEx("columns/item"); foreach (var item in items) { if (item.InnerHtml.Length == 0) { brush.DrawFormat("<td data-proxy=\"{0}\"{1}{2}></td>", GetSystemProxyCode(item), SealedPainter.GetFullClassName(item), SealedPainter.GetStyleCode(item)); } else { brush.DrawFormat("<td{0}{1}>", SealedPainter.GetFullClassName(item), SealedPainter.GetStyleCode(item)); obj.Elements.Render(brush, item.InnerHtml); //brush.DrawXaml(item.InnerHtml); brush.Draw("</td>"); } brush.DrawLine(); } brush.DrawLine("</tr>"); brush.Draw("</tbody>"); }
private string CreateTheadHeading(HtmlNode node) { var items = node.SelectNodesEx("headers/item"); if (items.Count == 0) { return(string.Empty); } StringBuilder html = new StringBuilder(); html.AppendFormat("<tr role=\"row\" class=\"heading{0}\">", HaveFilters(node) ? string.Empty : " noFilters"); html.AppendLine(); var selectMode = node.GetAttributeValue("select", "false"); if (selectMode == "true") { html.AppendLine("<th class=\"table-checkbox\"><input type=\"checkbox\" class=\"group-checkable\"/></th>"); } foreach (var item in items) { html.AppendFormat("<th{0}{1}>{2}</th>", SealedPainter.GetFullClassName(item), SealedPainter.GetStyleCode(item), item.GetAttributeValue("text", string.Empty)); html.AppendLine(); } html.AppendLine("</tr>"); return(html.ToString()); }
private string CreateTheadFilter(HtmlNode node) { var items = node.SelectNodesEx("filters/item"); if (items.Count == 0) { return(string.Empty); } StringBuilder html = new StringBuilder(); html.AppendLine("<tr role=\"row\" class=\"filter\">"); var selectMode = node.GetAttributeValue("select", "false"); if (selectMode == "true") { html.AppendLine("<td></td>"); } foreach (var item in items) { string colspan = item.GetAttributeValue("colspan", string.Empty); if (colspan.Length > 0) { colspan = string.Format(" colspan=\"{0}\"", colspan); } html.AppendFormat("<td{0}{1}{2}>{3}</td>", SealedPainter.GetFullClassName(item), SealedPainter.GetStyleCode(item), colspan, item.InnerHtml); html.AppendLine(); } html.AppendLine("</tr>"); return(html.ToString()); }
private static string CreateHeadCode(HtmlNode node) { StringBuilder html = new StringBuilder(); html.AppendLine("<thead><tr>"); var items = node.SelectNodesEx("core/headers/item"); foreach (var item in items) { var name = item.InnerText; html.AppendFormat("<th {0}{1}>{2}</th>", SealedPainter.GetFullClassName(item), SealedPainter.GetStyleCode(item), name); } if (ShowOperation(node)) { html.AppendLine("<th class=\"text-center\">操作</th>"); } html.Append("</tr></thead>"); return(html.ToString()); }