Пример #1
0
        private Task <string> GetHeaderAsync(TreeDefinition treeModel, List <TreeEntry> data, TreeSetup setup)
        {
            HtmlBuilder hb = new HtmlBuilder();

            if (treeModel.ShowHeader)
            {
                PropertyData prop = ObjectSupport.GetPropertyData(treeModel.RecordType, nameof(TreeEntry.Text));
                // Caption
                string caption = treeModel.Header.ToString();
                if (string.IsNullOrWhiteSpace(caption))
                {
                    caption = prop.GetCaption(null);
                }
                // Description
                string description = treeModel.HeaderTooltip.ToString();
                if (string.IsNullOrWhiteSpace(description))
                {
                    description = prop.GetDescription(null);
                }

                string alignCss = "tg_left";

                // Render column header
                hb.Append($@"
    <div class='{alignCss} tg_header{(treeModel.UseSkinFormatting ? " ui-state-default" : "")}' {Basics.CssTooltip}='{HAE(description ?? "")}'>
        <span>{HE(caption)}</span>
    </div>");
            }
            return(Task.FromResult(hb.ToString()));
        }