We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Delete function return the primary key in the request payload in inappropriate?

Thread ID:

Created:

Updated:

Platform:

Replies:

149008 Nov 12,2019 03:23 AM UTC Nov 12,2019 01:57 PM UTC Vue 1
loading
Tags: Data Grid
Chew Ann Kenn
Asked On November 12, 2019 03:23 AM UTC

Hi,

I am trying to perform the delete function from the data grid. I have set one data column is the primary key.
Therefore, it return the URL is considered correct as shown in the screenshot. "http://localhost:5000/api/user/23"

However it still meets error line is because the request payload only returns a value with number without any key like a json object format?

I also tried to bind it with the params, this.query = new Query().addParams("id", 23), however it still cannot store it.

Is there any clue on set the request data in JSON format, exmaple: "id" : "23", and that will fix my issue.

Awaiting your soonest reply for help

Attachment: Dashboard_2d81e668.rar

Thavasianand Sankaranarayanan [Syncfusion]
Replied On November 12, 2019 01:57 PM UTC

Hi Chew, 

As per webApi standard, we have sent the Http POST, PUT, DELETE request to perform the CRUD actions in server side along with their primary key value. However if you wish to modify the request url data then you can achieve it by overriding the required CRUD operation methods in the custom adaptor and changing the request url as per your need. 

// Custom adaptor 
class SerialNoAdaptor extends WebApiAdaptor { 
            // Delete operation 
            remove(dm, keyField, value, tableName) { 
                return { 
                    type: 'DELETE', 
                    // Here you can modify the request url as per your requirement 
                    url: dm.dataSource.url + ‘/id:’ + value,   
                    data: JSON.stringify(value) 
                }; 
            }         
} 

Regards, 
Thavasianand S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon