Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

288
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda