Exemple #1
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            Value        = TagHelperTools.FirstLetterToLower(Value);
            OptionsValue = TagHelperTools.FirstLetterToLower(OptionsValue);
            Options      = TagHelperTools.FirstLetterToLower(Options);
            OptionsText  = TagHelperTools.FirstLetterToLower(OptionsText);

            Id = Id == null?TagHelperTools.GetID() : Id;

            if (IsFormControl)
            {
                output.TagName = "div";
                output.Attributes.Add("class", $"form-group-sm col-md-{Col}");
                output.TagMode = TagMode.StartTagAndEndTag;
            }

            if (WithLabel)
            {
                template += $"<label class='control-label'>{Label}</label>";
            }

            template += $"<select class='form-control show-tick input-sm' data-style='btn btn-info btn-sm' data-bind='selectPicker: {Value}, optionsText: \"{OptionsText}\", optionsValue : \"{OptionsValue}\",  selectPickerOptions: {{ optionsArray: {Options} }}'></select>";

            output.Content.SetHtmlContent(template);
        }
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            Input = TagHelperTools.FirstLetterToLower(Input);
            Id    = Id == null?TagHelperTools.GetID() : Id;

            if (IsFormControl)
            {
                output.TagName = "div";
                output.Attributes.Add("class", $"form-group-sm col-md-{Col}");
                output.TagMode = TagMode.StartTagAndEndTag;
            }

            template += $"<label class='control-label'>{Label}</label>";
            template += $"<input class='form-control' data-bind='value: {Input}'></input>";

            output.Content.SetHtmlContent(template);
        }
Exemple #3
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            Id = Id == null?TagHelperTools.GetID() : Id;    // Todo Was nun?

            if (IsFormControl)
            {
                output.TagName = "div";
                output.Attributes.Add("class", $"form-group-sm col-md-{Col}");
                output.TagMode = TagMode.StartTagAndEndTag;
            }
            template += "<div class='form-group-sm col-md-12'>";
            template += $"<label class='control-label'>&nbsp;</label>";
            template += "</div>";
            template += "<div class='form-group-sm pull-right'>";
            template += IsSave ? $"<button style='margin-left:10px;' class='btn btn-warning btn-sm' data-bind='click: {Save},disable: window.isLoading'>Speichern</button>" : "";
            template += IsInsert ? $"<button style='margin-left:10px;' class='btn btn-info btn-sm' data-bind='click: {Insert},disable: window.isLoading'>Einfügen</button>" : "";
            template += IsEdit ? $"<button style='margin-left:10px;' class='btn btn-warning btn-sm' data-bind='click: {Edit},disable: window.isLoading'>Bearbeiten</button>" : "";
            template += IsDel ? $"<button style='margin-left:10px;' class='btn btn-danger btn-sm' data-bind='click: {Del},disable: window.isLoading,{DelBind}'>Löschen</button>" : "";
            template += "</div>";

            output.Content.SetHtmlContent(template);
        }
Exemple #4
0
        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            Value = TagHelperTools.FirstLetterToLower(Value);
            Id    = Id == null?TagHelperTools.GetID() : Id;

            //Array OptionsArray = System.Enum.GetValues(EnumType);


            var enumVals = new List <object>();

            foreach (var item in Enum.GetValues(EnumType))
            {
                enumVals.Add(new
                {
                    id   = (int)item,
                    name = item.ToString()
                });
            }

            string Options = JsonConvert.SerializeObject(enumVals);

            if (IsFormControl)
            {
                output.TagName = "div";
                output.Attributes.Add("class", $"form-group-sm col-md-{Col}");
                output.TagMode = TagMode.StartTagAndEndTag;
            }

            if (WithLabel)
            {
                template += $"<label class='control-label'>{Label}</label>";
            }

            template += $"<select class='selectpicker form-control show-tick input-sm' data-style='btn btn-info btn-sm' multiple='true' data-bind='selectedOptions: {Value}, optionsText: \"name\", optionsValue : \"id\", options: {Options}'></select>";

            output.Content.SetHtmlContent(template);
        }