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

Kendo React Grid, build programmatically

1 Answer 312 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SoH
Top achievements
Rank 1
Iron
Veteran
Iron
SoH asked on 16 Jun 2020, 06:09 PM

Does anyone know where I could find an example of a Kendo React Grid that is databound programmatically to an API Endpoint data source.

The paging would be done by passing a page number to the Endpoint.

I have no idea how to sort or filter the entire dataset if the grid is only showing a subset (page) of the data.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 17 Jun 2020, 07:39 AM

Hello,

This can be seen in our server operation demo:

https://www.telerik.com/kendo-react-ui/components/grid/data-operations/odata-server-operations/

This is using oData, but the approach is applicable to other APIs as well.

The main point is to handle the onDataStageChange event of the Grid, where we will provide an object with the Grid data state, page, sort, filter, etc. Then a request has to be made to the server with those parameters and the data that is returned has to be set to the Grid:

https://www.telerik.com/kendo-react-ui/components/grid/api/GridProps/#toc-ondatastatechange

Also, please have in mind that all data operation has to be done either on the server or on the client, mixing both is not supported as it creates many issues. For example, this is why we cannot perform a full sorting on the client if we only have the current page from the server. The operations have to be done where we have access to the entire data.

Regards,
Stefan
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
SoH
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Stefan
Telerik team
Share this question
or