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

84
Vistas
ag-grid data dependent on httprequest sometimes does not load the table

I'm trying to use a currency converter api and use its conversion data into my ag-grid table. The problem is when I load my page, sometimes the ag-grid table is loaded while sometimes it is not. There are occasions where I have to refresh the page multiple times to get the table to appear. If I run it on my local, I'm not encountering the problem.

Here's what I have so far:

function fxc(callback) {
    var requestURL = 'https://api.exchangerate.host/latest?base=EUR';
    var httpRequest = new XMLHttpRequest();
    httpRequest.onload = function(){ 
       callback(httpRequest.response);
    };
    httpRequest.open('GET', requestURL);
    httpRequest.send();
}

fxc(function(result) {
   const xxhr = JSON.parse(result)
   var usdrate = 1/xxhr.rates.USD
   ***ag-grid functions/codes using usdrate**
});

AG-GRID section has an addEventListener so it feels like its conflicting with the onload = function

document.addEventListener('DOMContentLoaded', function() {
    var gridDiv = document.querySelector('#myGrid');
    new agGrid.Grid(gridDiv, gridOptions);

    agGrid
        .simpleHttpRequest({
            url: 'csvjson.json',
        })
        .then(function(data) {
            gridOptions.api.setRowData(data);

            autoSizeAll(false);
        });
});
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