protected override void FillLabel(HtmlNode node, PageBrush brush) { var labelNode = node.SelectSingleNodeEx("label"); if (labelNode == null) { brush.Draw("<label class=\"control-label\" data-name=\"label\">"); if (ShowOperation(node)) { brush.Draw("<button class=\"btn btn-sm green\" data-name=\"addItem\"><i class=\"fa fa-plus\"></i>新增项</button>"); } brush.Draw("</label>"); return; } string className = LayoutUtil.GetClassName(labelNode, "control-label"); brush.DrawFormat("<label class=\"{0}\" data-name=\"label\">{1}", UIUtil.GetClassName(labelNode, className), labelNode.InnerText); if (ShowOperation(node)) { brush.Draw(" <button class=\"btn btn-sm green\" data-name=\"addItem\"><i class=\"fa fa-plus\"></i>新增项</button>"); } brush.Draw("</label>"); brush.DrawLine(); }
protected virtual void FillBrowseContainer(HtmlNode node, PageBrush brush) { var browseNode = node.SelectSingleNodeEx("browse"); if (browseNode != null) { string className = LayoutUtil.GetClassName(browseNode, "input-browse"); className = UIUtil.GetClassName(browseNode, className); string proxyCode = UIUtil.GetJSONMembers(browseNode, "only", "submit"); if (!string.IsNullOrEmpty(proxyCode)) { proxyCode = "{" + proxyCode + "}"; } SealedPainter.CreateNodeCode(brush, "div", className, string.Empty, proxyCode, (pageBrush) => { FillBrowse(node, browseNode, pageBrush); }, () => { return("data-name='browseContainer'"); }); //html.AppendLine(code); } }
protected override void FillCoreContainer(SealedControl obj, HtmlNode node, PageBrush brush) { var hasBrowseNode = node.SelectSingleNodeEx("browse") != null; var coreNode = node.SelectSingleNodeEx("core"); if (coreNode == null) { throw new WebException("没有指定core节点"); } string className = LayoutUtil.GetClassName(coreNode, "input-extend"); string styleCode = hasBrowseNode ? "display:none;" : string.Empty; if (!string.IsNullOrEmpty(styleCode)) { styleCode = string.Format(" style=\"{0}\"", styleCode); } SealedPainter.CreateNodeCode(brush, "div", className, styleCode, GetCoreContainerProxyCode(node), (pageBrush) => { FillCore(obj, node, coreNode, pageBrush); }, () => { return("data-name='coreContainer'"); }); //html.AppendLine(code); }
private string GetClassName(HtmlNode node, bool isSetCoreSuffix) { var defaultClassName = isSetCoreSuffix ? LayoutUtil.GetClassName(node, "input-group input-extend") : LayoutUtil.GetClassName(node, "input-extend"); return(UIUtil.GetClassName(node, defaultClassName)); }
protected virtual void FillHelp(HtmlNode node, PageBrush brush) { var helpNode = node.SelectSingleNodeEx("help"); if (helpNode == null) { return; } string className = LayoutUtil.GetClassName(helpNode, "help-block"); brush.DrawFormat("<span class=\"{0}\" data-name=\"help\">{1}</span>", UIUtil.GetClassName(helpNode, className), helpNode.InnerText); brush.DrawLine(); }
protected virtual void FillLabel(HtmlNode node, PageBrush brush) { string id = node.GetAttributeValue("id", string.Empty); var labelNode = node.SelectSingleNodeEx("label"); if (labelNode == null) { string forCode = string.IsNullOrEmpty(id) ? string.Empty : string.Format(" for=\"control_{0}\"", id); brush.DrawFormat("<label class=\"control-label sr-only\"{0} data-name=\"label\"></label>", forCode); return; } else { var remove = labelNode.GetAttributeValue("remove", "false"); if (remove == "true") { return; //显示指定移除label标签 } string forCode = string.IsNullOrEmpty(id) ? string.Empty : string.Format(" for=\"control_{0}\"", id); string className = LayoutUtil.GetClassName(labelNode, "control-label"); brush.DrawFormat("<label class=\"{0}\"{1} data-name=\"label\">{2}</label>", UIUtil.GetClassName(labelNode, className), forCode, labelNode.InnerText); brush.DrawLine(); } }
private string GetClassName(HtmlNode objNode) { var defaultClassName = LayoutUtil.GetClassName(objNode, "control-label"); return(UIUtil.GetClassName(objNode, defaultClassName)); }
private string GetClassName(HtmlNode objNode) { string className = LayoutUtil.GetClassName(objNode, "input-browse"); return(UIUtil.GetClassName(objNode, className)); }
private string GetClassName(HtmlNode objNode) { var defaultClassName = LayoutUtil.GetClassName(objNode, "help-block"); return(UIUtil.GetClassName(objNode, defaultClassName)); }
private string GetClassName(DynamicInput obj, HtmlNode objNode) { return(LayoutUtil.GetClassName(objNode, "row dynamic")); }