Help changing data in a table

Help changing data in a table

JoshkunzJoshkunz Posts: 1Questions: 0Answers: 0
edited February 2011 in General
Ok so I have a table which I want to update dynamically via an ajax request which works fine the first time. However, if I try and make the table again it screws up the columns and all of the data gets mixed together.

Here is the code I have been using:

[code]
dTable = $("#example").dataTable({
aaData: data,
aoColumns: columns,
bJQueryUI: true,
bDestroy: true,
sScrollX: "100%"
});
[/code]

I have also tried running fnDraw, fnClearTable, fnAddData and such. Is there any way that I can get basically a completely new table every time?

Replies

  • jchannonjchannon Posts: 26Questions: 0Answers: 0
    I was just about to post the same question and found this.

    I see there is a fnUpdate method but I'm not sure whether that will work as its documented as updating a row or cell. I want to return a whole new set of data and get the table to re-draw with it. In my AJAX request I will be returning the data via JSON.
This discussion has been closed.