I have been looking through the postings but can't find one that addresses by specific issue. I have a grid that is being loaded with data just fine on the initial page request. But now the user wants to select a subset of the data.
Here is the grid HTML helper from the MVC razor view page:
@(Html.Kendo().Grid<AdvisorSearchResultsVM>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(a => a.AdvisorID);
columns.Bound(a => a.CIFID);
columns.Bound(a => a.FirstName);
columns.Bound(a => a.LastName);
columns.Bound(a => a.Status);
})
.Sortable()
.Pageable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("onError"))
.Model(model =>
{
model.Id(a => a.AdvisorID);
model.Field(a => a.AdvisorID).Editable(false);
})
.Read(read => read.Action("GetAdvisors","Advisor"))
)
)
I want to change the grid datasource action to call the Advisor controller GetRegistered method.
I tried doing this in a javascript method
$("#Grid").kendoGrid.dataSource.transport.options.read.action("/Advisor/GetRegistered");
But I get an error that says $(...).kendoGrid.dataSource is undefined.
Any suggestions?
Here is the grid HTML helper from the MVC razor view page:
@(Html.Kendo().Grid<AdvisorSearchResultsVM>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(a => a.AdvisorID);
columns.Bound(a => a.CIFID);
columns.Bound(a => a.FirstName);
columns.Bound(a => a.LastName);
columns.Bound(a => a.Status);
})
.Sortable()
.Pageable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.Error("onError"))
.Model(model =>
{
model.Id(a => a.AdvisorID);
model.Field(a => a.AdvisorID).Editable(false);
})
.Read(read => read.Action("GetAdvisors","Advisor"))
)
)
I want to change the grid datasource action to call the Advisor controller GetRegistered method.
I tried doing this in a javascript method
$("#Grid").kendoGrid.dataSource.transport.options.read.action("/Advisor/GetRegistered");
But I get an error that says $(...).kendoGrid.dataSource is undefined.
Any suggestions?