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. Image for the cookie policy date

Grid not loading remote JSON at all

Hello. First of all, I wish to say thanks for creating a wonderful plattform. Well, I have been the all day trying to load a remote JSON data into the Grid control, without success. According to the Documentation of Essential JS, I've included the CDN references for quick testing purposes:

<link rel="stylesheet" rel='nofollow' href="http://cdn.syncfusion.com/13.2.0.29/js/web/flat-azure/ej.web.all.min.css" />

<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jquery.easing.1.3.min.js"> </script>
<script src="http://cdn.syncfusion.com/js/assets/external/jquery.globalize.min.js"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js"></script>
<script src="http://cdn.syncfusion.com/13.2.0.29/js/web/ej.web.all.min.js"> </script>

My problem is that the following code does not worked for me while trying to request a JSON data:

 $(function () {
            var dataManager = ej.DataManager({
                url: 'http://localhost:6900/home/getjson',
                crossDomain: true
            });

            $('#Grid').ejGrid({
                dataSource: dataManager,
                allowPaging: true
            });
        });

I'm using ASP 4.5 MVC 4 on the server. At the beginning I thought that my JSON response was incorrect, but it is not. It's ok. I also tested with the Python's Web2py Framework (I'm primary a python developer) and the problem is the same: not rows at all.

So, can you please clarify me the correct process of loading JSON AJAX requests with the Grid control? I followed the example in the docs with the Northwind database:

http://mvc.syncfusion.com/Services/Northwnd.svc/Orders

But this request returns an XML if im correct, no? So, I'm lost :(

Thanks and good day!

1 Reply

RU Ragavee U S Syncfusion Team October 21, 2016 12:09 PM UTC

Hi Aligha, 

Thanks for your interest in Syncfusion products. 

We analyzed the code examples that you have shared. By default, if the url property of the ejDataManager is used to bind data to grid, the url is considered as a Odata service. If you would like to fetch data from a custom action of controller, then we suggest you to use the URL adaptor concept of the DataManager. 

Please refer to the below online documentation in which we have explained in detail on the various data binding concepts to grid. 




We have prepared a grid sample with URL adaptor binding, which can be downloaded from the below location. 


Regards, 
Ragavee U S. 


Loader.
Up arrow icon