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

DataManager and CORS request

Thread ID:

Created:

Updated:

Platform:

Replies:

127274 Nov 7,2016 11:08 PM UTC Nov 8,2016 12:25 PM UTC ASP.NET MVC 1
loading
Tags: Grid
Stephen Harris
Asked On November 7, 2016 11:08 PM UTC

I am making a request to a cross-domain server for data to populate a Syncfusion Grid. The error I am getting is along the lines of:xmlhttprequest cannot load no 'access-control-allow-origin'.... The response had HTTP status code 405. This error is caused by a request that crosses two different domains. I Google the problem and see that the ej.DataManager request needs to employ Cross Origin Resource Sharing (CORS) to avoid the error. The request is below. Am I using the wrong adaptor?

var dataManager = ej.DataManager({
url: urlStr,
adaptor: new ej.WebApiAdaptor()
});

$("#GridMaster").ejGrid({
dataSource: dataManager,
allowSelection: true,
selectionType: "multiple",
allowPaging: true,
enablePaging: true,
pageSettings: { pageSize: 20 }
});

Jayaprakash Kamaraj [Syncfusion]
Replied On November 8, 2016 12:25 PM UTC

Hi Stephen, 
 
Thank you for contacting Syncfusion support. 
 
To overcome this problem, we suggest you to set crossDomain as true in ejDataManager. The crossDomain is used to retrieve data from another domain. Please refer to the below help document and code example. 
 
 
 
     var dataManger = ej.DataManager({ 
            url: urlStr, 
            crossDomain: true, 
            adaptor: new ej.WebApiAdaptor() 
        }); 
 
Regards, 
 
Jayaprakash K. 


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

;