MultiSelect and Enabling/Disabling Checkboxes

2 posts, 0 answers
  1. Gil
    Gil avatar
    3 posts
    Member since:
    Jun 2014

    Posted 07 Jul 2014 Link to this post

    Hi Kendo Team,

    I'm in the process of creating a page that uses MultiSelect with 5 values inside of it.  My objective is as users select the values a completely different set of checkboxes begin to enable or disable themselves based on the selections in the MS.  Unfortunately, it isn't working and I'm not entirely sure why.

    @{
        var funds = new List<SelectListItem> {
            new SelectListItem() {
                Text = "Value 1", Value = "1"
            },
            new SelectListItem() {
                Text = "Value 2", Value = "2"
            },
            new SelectListItem() {
                Text = "Value 3", Value = "3"
            },
            new SelectListItem() {
                Text = "Value 4", Value = "4"
            },
            new SelectListItem() {
                Text = "Value 5", Value = "5"
            }
        };
    }

        @(Html.Kendo().MultiSelect()
                .Name("select")
                .DataTextField("Text")
                .DataValueField("Value")
                .BindTo(funds)
                .Placeholder("Select Values ...")  
                .Events ( e =>
                              {
                                  .Select("select")
                              }    
        )


        function select(e) {
            var values = this.value();
            if ($.inArray("1", values) != -1) {
                $("group1").removeAttr("disabled");
            }

            else {
                $("group1").attr("disabled", true)
            }
                };
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 09 Jul 2014 Link to this post

    Hello Gil,

    The implementation shown in the code snippet seems OK. In order to find out why the code does not work, we will need a repro project. I will suggest you create a simple Dojo demo (in this case server wrapper is irrelevant). Thus will be able to investigate the issue further.

    Regards,
    Georgi Krustev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top