我有使用编辑器模板的级联下拉的kendo网格。这里的问题是当编辑下拉列表显示空白但是当点击下拉休息功能正常工作时。请帮助我这就是为什么它发生这样的事情
@(Html.Kendo().Grid(Model.Locations)
.Name("Grid")
.HtmlAttributes(new { style = "min-height:400px" })
.Columns(columns =>
{
columns.Command(command => { command.Edit().HtmlAttributes(new { type = "button", @class = "btn btn-primary button" }); }).Width(100);
columns.Bound(p => p.LocationId).Width(140).Hidden(true);
columns.Bound(p => p.LocationName).Width(140);
columns.Bound(p => p.CountryId).EditorTemplateName("CountryNames").Title("CountryName").ClientTemplate("#:CountryName#").Width(150);
columns.Bound(p => p.StateId).EditorTemplateName("StateNames").Title("StateName").ClientTemplate("#:StateName#").Width(150);
columns.Bound(p => p.IsActive).Width(100);
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Navigatable()
.Sortable()
.Scrollable()
.Groupable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(false)
.Events(events => { events.Error("error_handler"); events.RequestEnd("onRequestEnd"); })
.Model(model => { model.Id(p => p.LocationId); model.Field(p => p.LocationId).Editable(false); })
.Update(update => update.Action("Update_Location", "Administration"))
)
)
@using System.Collections
@model System.Int16?
@(Html.Kendo().DropDownList()
.Name("CountryId")
.AutoBind(false)
.DataTextField("CountryName")
.DataValueField("CountryId")
.DataSource(source =>
{
source.Read(read => { read.Action("", "").Data("filterState"); }).ServerFiltering(true);
})
.BindTo((IEnumerable)ViewData["Countries"])
)
<script>
function filterState() {
return {
countryId: $("#CountryId").val()
};
}
</script>
@model int?
@(Html.Kendo().DropDownList()
.Name("StateId")
.DataTextField("StateName")
.DataValueField("StateId")
.DataSource(source =>
{
source.Read(read => { read.Action("GetGridStateList", "Administration").Type(HttpVerbs.Post).Data("filterState"); }).ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("CountryId")
)
<script>
function filterState() {
debugger;
return {
countryId: $("#CountryId").val()
};
}
</script>