1

我有两个剑道下拉列表,我正在尝试禁用级联下拉列表。它不起作用,只有主下拉菜单被禁用。

@(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 下拉菜单已禁用,但 ABSID 未禁用

4

1 回答 1

0

当 DropDownList 从另一个级联时,有额外的逻辑来处理这种禁用。

在您的情况下,您已经为第一个 DropDownList 设置了值,这意味着第二个 DDL 将被启用。

于 2014-03-04T19:47:12.227 回答