This is a migrated thread and some comments may be shown as answers.

MultiSelect and Enabling/Disabling Checkboxes

1 Answer 165 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Gil
Top achievements
Rank 1
Gil asked on 07 Jul 2014, 05:20 PM
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)
        }
            };

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 09 Jul 2014, 08:56 AM
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.

 
Tags
MultiSelect
Asked by
Gil
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or