Completed
Last Updated: 29 Apr 2020 16:05 by ADMIN
Release 2.11.0
José Ángel
Created on: 05 Mar 2020 11:41
Category: Grid
Type: Feature Request
8
filter server side - serialize DataSourceRequest from a WASM app to remote endpoint

I want to fetch grid records page per page according to the appropriate filter settings. While this is possible through the OnRead event, I want to be able to send the request to the server so that it is easier to fetch the data, like in the UI for ASP.NET Core grid. Currently you can do this only for a server-side project because you can pass the request object by reference, but for a WASM project it needs to serialize in an HTTP request.

---

ADMIN EDIT

You can find examples of doing this here: https://github.com/telerik/blazor-ui/tree/master/grid/datasourcerequest-on-server

---

2 comments
ADMIN
Marin Bratanov
Posted on: 06 Apr 2020 09:20

In the meantime, the Service example from the Grid State article shows one custom serializer that you can use for the time being: https://docs.telerik.com/blazor-ui/components/grid/state#save-and-load-grid-state-from-browser-localstorage

 

Regards,
Marin Bratanov
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.
ADMIN
Marin Bratanov
Posted on: 05 Mar 2020 11:44

Hi,

You can use the OnRead event for that: https://docs.telerik.com/blazor-ui/components/grid/manual-operations

This particular snippet shows how you can page from a remote service: https://docs.telerik.com/blazor-ui/components/grid/manual-operations#custom-paging-with-a-remote-service.

You can see how to extract filter information so you can send it to the service in this snippet: https://docs.telerik.com/blazor-ui/components/grid/manual-operations#get-information-from-the-datasourcerequest

If you already have an OData service, you can consume it much more easily: https://github.com/telerik/blazor-ui/tree/master/grid/odata

We will also make the DataSourceRequest object serializable so you can skip all the information extraction and directly send it over to a controller action, in a fashion very similar to our UI for ASP.NET Core grid (reference - see the IndexController.cs and the Read events in it, the goal is for something similar to be available : https://demos.telerik.com/aspnet-core/grid/index).

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor