Help changing data in a table
Help changing data in a table
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?
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?
This discussion has been closed.
Replies
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.