define a custom post payload parameter in react data and send

2 Answers 67 Views
Grid
n/a
Top achievements
Rank 1
Iron
Iron
n/a asked on 21 Nov 2022, 12:12 PM

Hello! I want to define a custom post parameter in react, not just a get parameter.

https://stackblitz.com/edit/react-5u4erk?file=app%2Fmain.tsx

 

now :

 

 

I want payload :  recently, isDeleteList  send.

How can I do it? Thank you!

2 Answers, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 23 Nov 2022, 09:32 AM

Hi, Won,

Thank you for reaching out to us.

The OData Server Operations demos in our docs are intended to showcase how the Grid component can handle remote data operations, however, scenarios such as making a POST request would require the developer to set up an endpoint that accepts POST requests and configure the said request per his needs.

I hope this helps.

Regards,
Filip
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
n/a
Top achievements
Rank 1
Iron
Iron
answered on 23 Nov 2022, 03:40 PM
The target url (Products?$count=true&.....) can be configured by me. No need to worry about coding for the target URL.

I just want to know how to send additional parameters to the target url with post method.

How to do it in kendo react grid?

Is it impossible to answer based on the example above?
Filip
Telerik team
commented on 25 Nov 2022, 11:23 AM

Hi, Won,

I would love to provide a working solution, however, the issue is that the backend service used in the example is not configurated to accept POST requests, it was intended for GET requests in order to showcase how server-side operations can be done by subscribing to events emitted by the Grid component.  

The backend implementation and configuration should be done by the developer itself and the POST query will depend on that. 

Nevertheless, I can recommend this StackOverflow question and first answer as it shows how to send additional params via Axios:

https://stackoverflow.com/questions/68707047/how-to-send-a-post-request-with-variables-in-react

I realize that this is not the solution you are looking for, however, it might prove useful.

Regards,
Filip
Tags
Grid
Asked by
n/a
Top achievements
Rank 1
Iron
Iron
Answers by
Filip
Telerik team
n/a
Top achievements
Rank 1
Iron
Iron
Share this question
or