Hi there,
I am using DataGrid with UrlAdaptor and the backend is a relational database.
Assume the data grid UI is showing the 3rd page of records where the "skip" is 24 and "take" is 12 in
DataManagerRequest. Later the user deletes a few records on this 3rd page. In order to return the aftermath result of deletion back to the Data Grid UI, we need to know the current paging information (i.e. skip is 24 and take is 12).
My question is how can we pass this paging related data to the ASP.NET server side? It will be great that I don't need to implement a server-side solution that could force a session or could trigger a bigger concern in terms of fail over. Hopefully there is a client solution that we can pass the data to the back end.
// This is the function signature where there is no place for the paging related data
public ActionResult Remove([FromBody] CRUDModel<T> value);
Thanks
Hi Jamie,
Thanks for contacting Syncfusion support.
Actually, in the data table, the primary key is enough to delete a record. In the same way, we send the primaryKey details only to the server on deleting a record in Grid.
Once the record is deleted, the Grid will automatically send the request to the URL to get the current page records.
Screenshot #1: Send the Primary key details on deleting a record
|
|
Screenshot #2: Grid will automatically send the request to the URL to get the current page data (Now Grid on 3rd page)
|
|
Screenshot #3: Response from the server
|
|
We have prepared a simple sample for your reference.
There is no need to send the page query details to the removeUrl method. What is the purpose of your requirement? Explain it in detail.
Regards,
Rajapandiyan S
First of all, I want to thank you very much for your information. Appreciate it.
Just one follow-up question, where can I find the documentation of the return value. I was confused about what I should return from Insert() and Remove(), and I thought I need to return the whole page worth of data back to UI. After seeing your sample, I just realize we return the JSON of the original request. Where I can find the documentation explaining what to return?
Thanks in advance
public IActionResult Insert([FromBody] CRUDModel<BigData> value)
{
. . .
return Json(value.Value); <<==
}
public IActionResult Remove([FromBody] CRUDModel<BigData> value)
{
. . .
return Json(value); <<==}
Hi Jamie,
You’re welcome.
Query: Where can I find the documentation of the return value.
Kindly refer to the below documentation which illustrates how to perform the CRUD actions with URL Adaptor.
Regards,
Rajapandiyan S