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

120
Views
¿Cómo pasar la entrada adecuada a ag-grid?

Me enfrento a un problema muy extraño, estoy configurando rowData para agGrid. Si paso la variable directamente, no funciona, pero la imprimo en la consola y la asignación funciona. Supongo que podría ser un problema de formato de datos, pero me pregunto cómo funciona cuando se copia desde la consola.

 const getPeerData = (rows) => { let company = rows; console.log(company) // If I copy from console and paste like below it's working fine company = [{ "currency": "USD", "count": 24 }] return company; }; const gridOptions = { columnDefs : columnDefs, rowData : getPeerData(peerData), // I tried rowData = peerData but it's not working rowSelection : 'single' };

¿Qué podría estar mal aquí?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

configure la cuadrícula después de que la página haya terminado de cargarse: -

 const getPeerData = (rows) => { let company = rows; console.log(company) company = [{ "currency": "USD", "count": 24 }]; return company; }; // setup the grid after the page has finished loading document.addEventListener('DOMContentLoaded', function () { var gridDiv = document.querySelector('#myGrid'); new agGrid.Grid(gridDiv, gridOptions); gridOptions.api.setRowData(getPeerData()); });

O,

Considere usar la versión reaccionar de ag-grid:-

https://plnkr.co/edit/NfTowhZqpqwd87HX

 render() { return ( <div style={{ width: '100%', height: '100%' }}> <AgGridReact modules={this.state.modules} columnDefs={this.state.columnDefs} defaultColDef={this.state.defaultColDef} onGridReady={this.onGridReady} rowData={this.state.rowData} /> </div> ); } }
about 4 years ago · Juan Pablo Isaza Report
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!