i have tried data binding through custom datasource i m able to do server side paging but Sorting Filtering are also happening on server side
AS per code I have set serverfilter to false it should happen at client side but still making hit to method
Please suggest and provide a solution to acheive server side paging only rest sorting filtering grouping at clientside ASAP
@(Html.Kendo().Grid<OrderViewModel>() .Name("grid") .DataSource(dataSource => dataSource .Custom() .Type("aspnetmvc-ajax") .PageSize(10) .ServerPaging(true) .ServerSorting(false) .ServerFiltering(false) .Transport(transport => transport .Read(read => read.Action("Read", "Home")) ) .Schema(schema => schema .Data("Data") .Total("Total") .Errors("Errors") .Parse(@<text>function (data) { // configure a parse function only if the response (data) must be // transformed in some way before data binding return data; }</text>) .Model(model => { model.Id("OrderID"); model.Field("OrderID", typeof(int)); model.Field("OrderDate", typeof(DateTime)); model.Field("OrderDescription", typeof(string)); model.Field("IsCompleted", typeof(bool)); }) ) ) )
1 Answer, 1 is accepted
0
Alexander
Telerik team
answered on 19 Jun 2023, 04:36 AM
Hi Amir,
Generally, mixing the client-side and server operations is not recommended. A similar topic has been discussed within the following forum post that could potentially shed more light into the subject:
Nonetheless, if you wish to have full ownership over which server operations should be enabled, a possible approach would indeed involve defining a custom DataSource that allows you to explicitly set the client-side API options of the Kendo UI for jQuery DataSource. You have to separately state the server operations: (server-filtering, server-sorting, server-paging, server-grouping, and server-aggregates).
However, it is important to explicitly set all of the operations based on your requirements and needs. For example:
This way, you can still preserve the current page and count being passed on the backend, whilst relying on the filtering and sorting being automatically calculated on the client side.
If the mentioned above sample still executes the filtering on the server-side, I would recommend sharing an isolated runnable sample where the issue is reproduced.
Additionally, I have noticed there is no Telerik UI for ASP.NET Core Licenses associated with your account. Meaning that this further limits our support service as a whole. And the recommended action would be to either purchase or renew an existing license in order to make the most of the suite's features, bug fixes, and support service.
Although the mentioned above link contains the Support Plans, I am sending them here as well:
i have tried data binding through custom datasource i m able to do server side paging but Sorting Filtering are also happening on server side
AS per code I have set serverfilter to false it should happen at client side but still making hit to method
Please suggest and provide a solution to acheive server side paging only rest sorting filtering grouping at clientside ASAP
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.DataSource(dataSource => dataSource
.Custom()
.Type("aspnetmvc-ajax")
.PageSize(10)
.ServerPaging(true)
.ServerSorting(false)
.ServerFiltering(false)
.Transport(transport => transport
.Read(read => read.Action("Read", "Home"))
)
.Schema(schema => schema
.Data("Data")
.Total("Total")
.Errors("Errors")
.Parse(@<text>function (data) {
// configure a parse function only if the response (data) must be
// transformed in some way before data binding
return data;
}</text>)
.Model(model => {
model.Id("OrderID");
model.Field("OrderID", typeof(int));
model.Field("OrderDate", typeof(DateTime));
model.Field("OrderDescription", typeof(string));
model.Field("IsCompleted", typeof(bool));
})
)
)
)