Hi,
I have a Model object which is used to create the parent Kendo Grid. This Model object contains a list of object which is used as a data source to another nested grid created with a ClientDetailTemplate and DetailInit event. The nested grid is coming up fine but I am unable to perform any grid operations like sorting or filtering. It does not give any error but the grid just closes down.
I think I might be missing some configuration in DetailInit event method to make sure the sorting/filtering operations does not do server operations. So I used grid.dataSource.serveroperation = false; in detailInit event. still the grid just closes in and looks like its trying to do server operation for sorting and filtering. Following is an example of the code that I am using:
public class ParentModel
{
public long ParentId { get; set; }
public List<ChildModel> ChildModelList{ get; set; }
...
}
@(Html.Kendo().Grid<ParentModel>()
.Name("Grid")
...
.ClientDetailTemplateId("nested_grid")
.Events(e => e.DetailInit("detailInit"))
...
)
<script id="nested_grid" type="text/kendo-tmpl">
@(Html.Kendo().Grid<ChildModel>()
.Name("ParentModel_#=ParentId#")
.Sortable()
.Filterable()
.ToClientTemplate()
)
</script>
<script>
function detailInit(e) {
var grid = $("#ParentModel_" + e.data.Name).data("kendoGrid");
grid.dataSource.data(e.data.ChildModelList);
grid.dataSource.serveroperation = false;
}
</script>