Show Object Callback Ajax To Data Table

Show Object Callback Ajax To Data Table

adolineadoline Posts: 3Questions: 1Answers: 0


Answers

  • adolineadoline Posts: 3Questions: 1Answers: 0

    Please help, how can I display this data in the table

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    If you are using ajax then use ajax.dataSrc to point to the row data. See the second example in the docs. Use columns.data to define the columns. See this example.

    Kevin

  • adolineadoline Posts: 3Questions: 1Answers: 0
    edited November 2022

    I used ajax.datasrc and nothing was displayed in the table
    I send a request to php using separate ajax and the table information is sent to me in the format of the above image, then I want to display this information in the table

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    You have an array of objects which requires the use of columns.data. Did you configure columns.data?

    Take a look at the Ajax docs.

    Use the browser's network inspector to see the XHR response to verify what is returned. At a minimum post a sample of the JSON data in the XHR response and your Datatables initialization code.

    Better is to post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Or use the Debugger and post the generated code for the developers to look at.

    Kevin

Sign In or Register to comment.