This is a migrated thread and some comments may be shown as answers.

Client side sorting with server side data source

2 Answers 1786 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jairo
Top achievements
Rank 1
Jairo asked on 13 Jun 2017, 04:17 PM

Hello there,

Just a question, is it possible to have server side data (using a web service) but client side sorting? (if so...how?)

I currently have a Kendo Grid bound to a remote data source and even if I set the serverSorting to false it still goes to the server to retrieve the page data and then sort it.

On this application the grid displays one page of data at a time, so sorting should run on the client side with the page data it's got already, no need to hit the server again...right?

Here is my current grid configuration:

$("#contractorsGrid").kendoGrid({
dataSource: {
transport: { read: "/Contractors" },
pageSize: 10,
serverPaging: true,
serverFiltering: true,
serverSorting: false,
schema: { total: "total", data: "data" }
},
height: 550,
scrollable: true,
sortable: true,
serverSorting: false,
pageable: {
input: true,
numeric: false
},
filterable: false,
columns: [
{ command: { click: this.editContractor, name: "modify", text: "Edit" }, width: "80px" },
{ field: "id", title: "ID", width: "80px" },
{ field: "name", title: "Contractor" },
{ field: "contactname", title: "Contact" },
{ field: "contactphone", title: "Phone" },
{ field: "supervisorname", title: "Supervisor" },
{ field: "supervisorphone", title: "Sup. Phone" }
]
});

 

Thanks for any help!

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Jun 2017, 07:27 AM
Hello Jairo,

After inspecting the provided code, the result is expected because the serverPaging is set the true, and the Grid does not have all of the data on the client in order to make the correct sorting.

It is recommended to have all operation either on the client or on the server, as otherwise different issues as this one may occur:

http://docs.telerik.com/kendo-ui/framework/datasource/overview#mixed-data-operations-mode

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Anton
Top achievements
Rank 1
answered on 02 Oct 2017, 02:59 AM
Hi Jairo, I had same issue and come up with the workaround. It is pretty long, so published here: http://tsherlock.tech/2017/09/30/kendo-grid-workaround-for-client-side-groupping/
Tags
Grid
Asked by
Jairo
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Anton
Top achievements
Rank 1
Share this question
or