[Help] Manually overwriting table rows and redrawing the DataTable

[Help] Manually overwriting table rows and redrawing the DataTable

NelsonTigerNelsonTiger Posts: 3Questions: 0Answers: 0
edited April 2014 in DataTables 1.10
The tbody for my table has an ID.

[code][/code]

I call an AJAX function that returns HTML for the table rows.

[code]$.get("pic_ajax.php", {what: "upload_refresh_history"})...

1002014-04-22 17:14:06
[/code]

After obtaining the HTML from my AJAX call I place it into $("#test_body") and want to redraw the DataTable to reflect the data. Using Firefox's element inspector I do not see the new data in my table. I am able to put the data anywhere else on the page.

http://live.datatables.net/migumuk/1/edit?html,js

Replies

  • allanallan Posts: 57,300Questions: 1Answers: 9,127 Site admin
    You have to use the DataTables API if you want to manipulate the data in the table - DataTables doesn't know that you've changed the HTML content. See http://datatables.net/faqs#append .

    DataTables 1.10's new `rows.add()` method accepts HTML input if your server can only return HTML.

    Allan
  • NelsonTigerNelsonTiger Posts: 3Questions: 0Answers: 0
    edited May 2014

    I was able to fix my issue. Take a look at this hackpad to view the code.

    I hope the next version includes support for server-side setting WHERE and JOIN. One user has edited ssp.class.php to support those two commands.

This discussion has been closed.