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

83
Views
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
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!