reload the table with an other data source

reload the table with an other data source

roineroine Posts: 14Questions: 0Answers: 0
edited April 2012 in General
Hi,

it's me again. Now my problem is to reload the dataTable with a new dataSource and new aoColumns.

Concretly I have 8 tables in my database and with a php code I generate an array , then I use GET to have access the different table of my database. Exemple: index.php?table=test1 (will display an array of the data from test1 table), index.php?table=test2.



Then in a second page I have a variable named table which contain the name of the differents tables and an array for the differents aoColumns.
When i change the value of the variable named table, and recharge the script I successfully get my new dataTable. How to do it dynamically with button element.

I have try something like
[code]
$("#test").click(function(){
table ='test2';
oTable.fnClearTable();
oTable.fnDraw();
})
[/code]
[code]
test
[/code]

But it doesn't works.

Replies

  • roineroine Posts: 14Questions: 0Answers: 0
    Anyone?
  • roineroine Posts: 14Questions: 0Answers: 0
    edited April 2012
    Fixed by using
    http://www.datatables.net/forums/discussion/5271/reload-table-with-new-data/p1

    But now I also need to change my aoColumns is there a way to reload a new aoColumns?
This discussion has been closed.