コード例 #1
0
        public static MvcHtmlString RenderItensDominioComboBox(this HtmlHelper helper,
                                                               string nome,
                                                               string nomeDominio,
                                                               object htmlAttributes  = null,
                                                               bool isToShowItemValue = false)
        {
            ComboBoxBuilder comboBoxBuilder = helper.Kendo().ComboBox();

            comboBoxBuilder.Name(nome);

            comboBoxBuilder.DataValueField("Vl_Item_Dominio");
            comboBoxBuilder.DataTextField("Dc_Item_Dominio");

            if (htmlAttributes != null)
            {
                comboBoxBuilder.HtmlAttributes(htmlAttributes);
            }

            comboBoxBuilder.DataSource(dataSource =>
            {
                dataSource.Read("ItensDominio", "Dominios", new { nomeDominio = nomeDominio, isToShowItemValue = isToShowItemValue });
            });

            return(MvcHtmlString.Create(comboBoxBuilder.ToHtmlString()));
        }
コード例 #2
0
        public static ComboBoxBuilder ConditionalChange(this ComboBoxBuilder builder, string handler, bool condition)
        {
            if (condition)
            {
                builder.Events(e => e.Change(handler));
            }

            return(builder);
        }
コード例 #3
0
        public static ComboBoxBuilder ConditionallyCascadeFrom(this ComboBoxBuilder builder, string cascadeFromId, bool condition)
        {
            if (condition)
            {
                builder.CascadeFrom(cascadeFromId);
            }

            return(builder);
        }
コード例 #4
0
 public static ComboBoxBuilder Width(this ComboBoxBuilder builder, int widthPixel)
 {
     return(builder.HtmlAttributes(new { style = string.Format("width: {0}px", widthPixel) }));
 }
コード例 #5
0
 public ComboBoxBuilderTests()
 {
     combobox = ComboBoxTestHelper.CreateComboBox();
     builder = new ComboBoxBuilder(combobox);
 }
コード例 #6
0
 public ComboBoxBuilderTests()
 {
     combobox = ComboBoxTestHelper.CreateComboBox();
     builder  = new ComboBoxBuilder(combobox);
 }