Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
How to bind JSON REST service to Syncfusion grid?

I'm using Syncfusion for a simple web page with a grid. My web service that feeds the grid initially returned just a JSON array, but after reading through the Syncfusion docs, I modified my JSON response to match what is required for the UrlAdapator. However, after doing this it's still not working - actually, I just get a blank page when I open the web page.

Here is the code to create the grid with data binding:

const SERVICE_URI = 'http://localhost:4000/users';

var data = new DataManager({
    url: SERVICE_URI,
    adaptor: new UrlAdaptor
}).executeQuery(new Query());

var grid = new ej.grids.Grid({
    dataSource: data,
    columns: [
            { field: 'UserName', headerText: 'Username', textAlign: 'Right', width: 120, type: 'string' },
            { field: 'FirstName', width: 140, headerText: 'First Name', type: 'string' },
            { field: 'LastName', headerText: 'Last Name', textAlign: 'Right', width: 120, format: 'string' }
    ],
    actionFailure: (e) => {
        var span = document.createElement('span');
        grid.element.parentNode.insertBefore(span, grid.element);
        span.style.color = "#FF0000"
        span.innerHTML = "Error";
    },
    height: 180
});

Here's an example of the JSON response from http://localhost:4000/users:

{"result": [{"UserName":"johnd","FirstName":"John","LastName":"Doe"},{"UserName":"doeJ","FirstName":"John","LastName":"Doe"},{"UserName":"jdoe","FirstName":"Jane","LastName":"Doe"}],"count": 3}

Any ideas for how to make my response work with an adapter or vice-versa?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!