Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

287
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda