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

67
Views
Datatables show loading... in tbody instead showing data

I am using datatables to get data from json but when the page is ready tbody show loading... instead showing data from json response

here is my json

{"response":{"data":[{"id":"64D3AFAFA8DE403A92DD836AC12ED903","organization":"3F8B3208255142DCB1D5C7AE542847B0","createdBy":"534F676339874A288518CD9D19086219","description":null,"documentNo":"PR.64","businessPartner":"DE1D64A7DED34BE3BBD1EA8BBA6540A1","documentStatus":"oez_waitingcomplete","recordTime":1634267761609}],"status":0}}

my script

$(document).ready(function(){
    $('#datatable').DataTable({
        "ajax": {
            "url": "myurl",
            "type": "GET",
            "dataSrc": "data"
        },
        "column": [
            {'data': 'documentNo'},
            {'data': 'organization'},
            {'data': 'createdBy'},
            {'data': 'documentStatus'},
            {'data': 'description'},
            {'data': 'id'}
        ]
    })
})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For this to work you must simply change your dataSrc to "response.data". The data array is inside the response object in your json response so this should do the trick.

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!