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

303
Views
Cómo vincular datos JSON de una llamada ajax a DataSource de la tabla dinámica webdatarocks

Aquí los datos no son vinculantes en el siguiente código:

 var pivot = new WebDataRocks({ container: "#wdr-component", toolbar: true, height: 395, report: { dataSource: { dataSourceType: "json", data: getData() }, "slice": { "rows": [ { "uniqueName": "RLI_RAV_GRP_DES" } ], "columns": [ { "uniqueName": "LEVEL1" }, { "uniqueName": "LEVEL2" } ], "measures": [ { "uniqueName": "Q1", "aggregation": "sum" }, { "uniqueName": "Q2", "aggregation": "sum" }, { "uniqueName": "Q3", "aggregation": "sum" }, { "uniqueName": "Q4", "aggregation": "sum" } ] }, options: { grid: { title: "Sales Report" } } } }); function getData() { $.ajax({ type: "GET", url: "NACGSample.aspx/GetPivotReportList", contentType: "application/json; charset=utf-8", dataType: 'json', success: function (msg) { return JSON.parse(msg.d); //return msg.d; }, error: function (msg) { return alert(msg); } }); }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El problema es que no puede devolver un valor de una llamada asincrónica (solicitud AJAX). La solución es llamar a una función dentro de su success: devolución de llamada que pasa los datos cuando están disponibles.

Consulte el siguiente CodePen: https://codepen.io/webdatarocks/pen/eYErgGL?editors=1010

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!