Ejemplo n.º 1
0
        void Inicializate(object htmlAttributes)
        {
            _select2Options = new Select2Options();

            _htmlAttributes = new HtmlAttributes(htmlAttributes);

            SetHtmlAttributesIfNull("style", "width: 100%");
            SetHtmlAttributesIfNull("class", "form-control");
            SetHtmlAttributesIfNull("name", (_htmlAttributes["name"] ?? _idControle) + (_select2Options.multiple ? "[]" : string.Empty));
        }
Ejemplo n.º 2
0
 public static MvcHtmlString Select2(this HtmlHelper htmlHelper, string id, SelectList itens, Select2Options select2Options, object htmlAttributes = null)
 {
     return(new Select2Builder(id, htmlAttributes).Config(select2Options).SetSelectList(itens).Montar());
 }
Ejemplo n.º 3
0
 public Select2Builder Config(Select2Options select2Options)
 {
     _select2Options = select2Options;
     return(this);
 }