0

我有 3 个DropDownList。当我从第一个中选择值时,第二个完美运行,Kendo 自动启用第二个并执行 AJAX 查询。但是当我从第二个中选择值时,第三个 DropDownList 仍然被禁用。

编码:

<script>
    function filterSchemas() {
        return { formGroupId: $("#FormGroupName").val() };
    }

    function filterRootElements() {
        return { shemaId: $("#Schemas").val() };
    }
</script>

<div class="editor-label">
    @Html.LabelFor(e => e.FormGroupName, "Form group")
</div>
<div class="editor-field">
    @(Html.Kendo().DropDownListFor(e => e.FormGroupName)
          .Name("FormGroupName")
          .OptionLabel("Select form group...")
          .DataValueField("Id")
          .DataTextField("Name")
          .Template("#= data.Name # (#= data.Version #)")
          .DataSource(dataSource =>
              {
                  dataSource.Read(read => read.Route(RouteConfig.GetFormGroupNames.Name)).ServerFiltering(true);
              })
    )
</div>

<div class="editor-label">
    @Html.LabelFor(e => e.Schema, "Schema")
</div>
<div class="editor-field">
    @(Html.Kendo().DropDownListFor(m => m.Schema)
          .Name("Schema")
          .OptionLabel("Select schema...")
          .DataValueField("SchemaId")
          .DataTextField("ShemaName")
          .DataSource(dataSource =>
              {
                  dataSource.Read(read => read.Route(RouteConfig.FilterFormSchemas.Name).Data("filterSchemas")).ServerFiltering(true);
              })
          .AutoBind(false)
          .Enable(false)
          .CascadeFrom("FormGroupName")
          )     
</div>

<div class="editor-label">
    @Html.LabelFor(e => e.Root, "Root element")
</div>
<div class="editor-field">
    @(Html.Kendo().DropDownListFor(m => m.Root)
          .Name("Root")
          .OptionLabel("Select root...")
          .DataValueField("RootId")
          .DataTextField("RootName")
          .DataSource(dataSource =>
              {
                  dataSource.Read(read => read.Route(RouteConfig.FilterFormRootElements.Name).Data("filterRootElements")).ServerFiltering(true);
              })
          .AutoBind(false)
          .Enable(false)
          .CascadeFrom("Schema")
          )     
</div>

有什么建议么?

4

0 回答 0