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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Component - sending POST request

Thread ID:

Created:

Updated:

Platform:

Replies:

140920 Nov 14,2018 09:59 AM UTC Nov 14,2018 12:00 PM UTC Angular - EJ 2 1
loading
Tags: Grid
Grzegorz Golen
Asked On November 14, 2018 09:59 AM UTC

Hi, In my project I try to use Grid Component and binding WebApiAdaptor (I have end point service). Insert new recond is by built-in toolbar item (add). How I can send http POST request to the webapi using WebApiAdaptor and this built-in (adding new record)?



Here's a code snippet:


        new DataManager({

            url: urlCreateJson,

            adaptor: new WebApiAdaptor,

            headers: [{'Content-Type': 'application/xml'},

            { 'Access-Control-Allow-Origin': 'localhost:4200' }, 

            { 'Content-Type': 'application/json' },

            { 'Authorization': 'Bearer Vh7oqektMBNhHiKOdE4pLPKksgWvan0wE6WkCDfMx-VdDmP86cr1w' }],

            requestType: 'POST',

            crossDomain: true

        });

        this.dm.executeQuery(new Query())

        .then((e: ReturnOption) => this.items = <Object[]>e.result).catch((e) => true);


Thank you in advance for your help.




Madhu Sudhanan P [Syncfusion]
Replied On November 14, 2018 12:00 PM UTC

Hi Grzegorz, 

Thanks for contacting Syncfusion support. 

From the code example we understood that you are performing data fetching externally using our DataManager. We suggest you to assign the DataManager directly to the dataSource property that handles all the grid actions and edit operations internally. Please go through the following links to use the assign dataSource as instance of DataManager. 



If the above link didn’t helped, please let us know we will provide sample based on your requirement. 

Regards, 
Madhu Sudhanan P 


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.

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

;