Выбираемая Kendo Grid не работает во всплывающем окне
Выдержка из файла.cshtml:
<tr>
<td colspan="3">
<input class="k-button" value="Associate Service Location" onclick="assocLoc(this) " data-request-url="@Url.Action("AssociateLocation", "BillingAccount", new { customerId = Model.Id })"/>
</td>
</tr>
<!-- and later in the same file: -->
<div id="AssocLocWindow" class="container-border-rounded"></div>
И связанный Javascript:
function assocLoc(sender) {
var win = $("#AssocLocWindow").kendoWindow({
title: "Associate Service Location to BillingAccount",
draggable: true,
modal: true,
content: $(sender).data("request-url"),
actions: ["Close"]
}).data("kendoWindow");
win.center();
win.open();
}
Вот соответствующий код контроллера:
public ActionResult AssociateLocation(int customerId)
{
var locations =
new List<AM.Web.Models.ServiceLocation>
{
new AM.Web.Models.ServiceLocation {Id = 1, AltId = "2", Description = "Bud's Roofing"},
new AM.Web.Models.ServiceLocation {Id = 3, AltId = "4", Description = "Sam's Plumbing"}
};
return this.PartialView("AssociateLocation", locations.AsEnumerable());
}
А вот определение Grid из AssociateLocation.cshtml:
@model IEnumerable<AM.Web.Models.ServiceLocation>
@(Html.Kendo()
.Grid(Model)
.Name("sLocGrid")
.Columns(columns =>
{
columns.Bound(results => results.Id);
columns.Bound(results => results.AltId);
columns.Bound(results => results.Description).Width(450);
})
.Selectable(selectable => selectable.Mode(GridSelectionMode.Multiple))
.DataSource(datasource => datasource
.Ajax()
.Read(read => read.Action("AssociateLocation", "BillingAccount", new {customerId = 1}))
.Model(model => model.Id(p => p.Id))
)
)
Проблема заключается в том, что модальное всплывающее окно отображается правильно, а данные с контроллера правильно вводятся в сетку, но строки сетки недоступны для выбора. Я пробовал выбор одной строки и выбор нескольких строк без удачи. Я также попробовал Editable(), чтобы посмотреть, сработает ли это, также безуспешно. Любые идеи с благодарностью.