1
votes

I have two kendo dropdown list and I'm trying to disable the cascading dropdown. It's not working and only the main dropdown is disabled.

@(Html.Kendo().DropDownListFor(m => m.SiteID)
                            .Name("SiteID")
                            .OptionLabel("Select Below...")
                            .DataTextField("Text")
                            .DataValueField("Value")
                            .Enable(false)
                            .Events(e => e.Change("categoriesChange"))
                            .Value(Model.SiteID.ToString())
                            .DataSource(ds =>
                            {
                                ds.Read("ToolbarTemplate_Categories", "EnterNewDocumentDesign");
                            })
                        )

@(Html.Kendo().DropDownListFor(m => m.ABSID)
                            .Name("ABSID")
                            .DataTextField("Text")
                            .DataValueField("Value")
                            .Events(e => e.Change("DocumentNumberChange"))
                            .Value(Model.ABSID.ToString())
                            .DataSource(ds =>
                            {
                                ds.Read(read => read.Action("ToolbarTemplate_ABS", "EnterNewDocumentDesign").Data("filterABS")).ServerFiltering(true);
                            })
                            .Enable(false)
                            .CascadeFrom("SiteID")

                        )
                <script>
                    function filterABS() {
                        return {
                            site: $("#SiteID").val(),
                            DocumentHeaderTypeID: "5",

                        };
                    }

                    $(document).ready(function () {
                        $("#ABSID").data("kendoDropDownList").enable(false);
                    });
                </script>

SiteID dropdown is disabled but not the ABSID

1
can i ask why you are disabling the cascade dropdownlist.....cz if you have 1.2.3 dropdownlist 2.3 always remains disabled unless you select value from 1st one...??? - Shazhad Ilyas

1 Answers

0
votes

When a DropDownList is cascading from another, there is extra logic that handles that disabling.

In your case you have set value for the first DropDownList which means the second DDL will become enabled.