Ejemplo n.º 1
0
        private HtmlTag renderStandard()
        {
            _htmlRoot = new HtmlTag("div");
            _htmlRoot.AddClass(_noClear ? "KYT_editor_root_no_clear" : "KYT_editor_root");
            if (_rootId.IsNotEmpty())
            {
                _htmlRoot.Id(_rootId);
            }
            if (_rootClass.IsNotEmpty())
            {
                _htmlRoot.AddClass(_rootClass);
            }
            EditorLabelExpression <VIEWMODEL>  labelBuilder = new EditorLabelExpression <VIEWMODEL>(_generator, _expression);
            IEditorInputExpression <VIEWMODEL> inputBuilder;

            if (_dropdown)
            {
                inputBuilder = new DropdownInputExpression <VIEWMODEL>(_generator, _expression, _dropdownWithItems);
            }
            else
            {
                inputBuilder = new EditorInputExpression <VIEWMODEL>(_generator, _expression);
            }
            addInternalCssClasses(labelBuilder, inputBuilder);
            hideElements(_htmlRoot, labelBuilder, inputBuilder);
            addIds(labelBuilder, inputBuilder);
            addCustomLabel(labelBuilder);
            HtmlTag input = inputBuilder.ToHtmlTag();
            HtmlTag label = labelBuilder.ToHtmlTag();

            _htmlRoot.Child(label);
            _htmlRoot.Child(input);
            return(_htmlRoot);
        }
Ejemplo n.º 2
0
        private HtmlTag renderInlineReverse()
        {
            _htmlRoot = new HtmlTag("div").AddClass("KYT_editor_root");
            if (_rootId.IsNotEmpty())
            {
                _htmlRoot.Id(_rootId);
            }
            if (_rootClass.IsNotEmpty())
            {
                _htmlRoot.AddClass(_rootClass);
            }
            EditorLabelExpression <VIEWMODEL> labelBuilder = new EditorLabelExpression <VIEWMODEL>(_generator, _expression);
            EditorInputExpression <VIEWMODEL> inputBuilder = new EditorInputExpression <VIEWMODEL>(_generator, _expression);

            addInternalCssClasses(labelBuilder, inputBuilder);
            hideElements(_htmlRoot, labelBuilder, inputBuilder);
            addIds(labelBuilder, inputBuilder);
            addCustomLabel(labelBuilder);
            HtmlTag label = labelBuilder.LeadingColon().ToHtmlTag();
            HtmlTag input = inputBuilder.ToHtmlTag();

            _htmlRoot.Child(input);
            _htmlRoot.Child(label);
            return(_htmlRoot);
        }