Topic: React Bootstrap Datatables - API: Table is not rendered when pulling data from URL

Ilya Kritsmer free asked 4 years ago


*Expected behavior*When the component pulls a JSON from API the table should display the data automatically

*Actual behavior*Nothing changes, the table stays with no rows. The JOSN which is pulled from the URL does work if referred locally (see it in Resources section)

*Resources (screenshots, code snippets etc.)*1. I am using 4.11.1 version since the last one gives some weird error when used alongside TypeScript code

  1. The component code (pretty much trivial) https://pastebin.com/SJg3reP6

3.Json which works perfect when referring it locally

const data = { columns: [ { label: 'Agent Api Version', field: 'agentApiVersion', sort: 'asc', width: 50 }, { label: 'Agent ID', field: 'id', sort: 'asc', width: 270 }, { label: 'Host', field: 'host', sort: 'asc', width: 270 }, { label: 'Pid', field: 'pid', sort: 'asc', width: 50 }, { label: 'Start Time', field: 'startTime', sort: 'asc', width: 100 }, { label: 'Update Time', field: 'updateTime', sort: 'asc', width: 150 }, { label: 'Company ID', field: 'companyId', sort: 'asc', width: 100 }, { label: 'Company Name', field: 'companyName', sort: 'asc', width: 100 } ], rows: [ { agentApiVersion: '0.56', id: '2342342342sert', host: 'FFFFF', pid: '12345', startTime: '2011/04/23', updateTime: '2011/04/25', companyName: 'FFFFF', companyId: '12345' } ]};


Jakub Chmura staff answered 4 years ago


Hi @Ilya Kritsmer,

First of all, please update the MDB version to the newest 4.24.0. Since 4.11.1v we released many improvements and bug fixes (is a possibility to your problem was fixed in further versions). If your problem has not disappeared in the latest version please let me know. Then we will try to figure out what went wrong.

Best, Kuba



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.11.1
  • Device: Destop
  • Browser: Any
  • OS: Ubuntu
  • Provided sample code: No
  • Provided link: Yes