Beispiel #1
0
        public override string GetHTML(int deep = 0)
        {
            if (string.IsNullOrEmpty(Select.Id_DOM))
            {
                if (!string.IsNullOrEmpty(Select.Name))
                {
                    Select.Id_DOM = Select.Name;
                }
                else
                {
                    Select.Id_DOM   = Guid.NewGuid().ToString().Replace("-", "");
                    Select.Name_DOM = Select.Id_DOM;
                }
            }
            Childs.Clear();
            if (!(LabelSelectMenu is null))
            {
                LabelSelectMenu.@for = Select.Id_DOM;
                Childs.Add(LabelSelectMenu);
            }
            if (!(SizeSelect is null))
            {
                Select.AddCSS("form-control-" + SizeSelect?.ToString("g"));
            }

            if (isCustomBootstrapSelect)
            {
                Select.AddCSS("custom-select");
            }

            Childs.Add(Select);

            return(base.GetHTML(deep));
        }
        public static div GetBootstrapSelectList(string label, select select_body, string Tooltip = null, string wrap_class = "input-group mb-4 col-auto")
        {
            div ret_dom = new div();

            ret_dom.AddCSS(wrap_class, true);
            if (!string.IsNullOrEmpty(label))
            {
                using (div input_group_prepend = new div())
                {
                    input_group_prepend.AddCSS("input-group-prepend");
                    ret_dom.AddDomNode(input_group_prepend);
                }
                //ret_dom.Childs[0].Childs.Add(new label(label, select_body.Id_DOM) { css_class = "input-group-text" });
            }
            select_body.AddCSS("custom-select");

            if (!string.IsNullOrEmpty(Tooltip))
            {
                ret_dom.title = Tooltip;
            }

            ret_dom.SetAttribute("data-toggle", "tooltip");
            ret_dom.AddDomNode(select_body);
            return(ret_dom);
        }
Beispiel #3
0
        public SelectMenu(string Label, select my_select)
        {
            if (!string.IsNullOrEmpty(Label))
            {
                LabelSelectMenu = new label(Label, my_select.Id_DOM);
            }

            tag_custom_name = typeof(div).Name;
            AddCSS("form-group");
            Select = my_select;
            Select.AddCSS("form-control");
        }