2 DB driven tables, cant refresh the sec one.

2 DB driven tables, cant refresh the sec one.

sangokusangoku Posts: 4Questions: 0Answers: 0
edited October 2011 in General
Hy i have 2 tables on 1 page which are fully DB handled.

like in : http://datatables.net/release-datatables/examples/data_sources/server_side.html

2 instances of em. Now i need to redraw once 1 and other time the other one. But in end i wind up only reloading the last one defined.

My question is. do i have to somehow clone the damn class or wtf is wrong with it. once when i created the data table i named the var otable1 and other time otable2 but which ever i redraw with the fnDraw() function only the last one gets reloaded... i see tht on my debuger on the backed script.... How can i reload them seperatly?
The tables have different backend handlers so there is no possibility i am wrong. My only question is how can i make 2 different fnDraw calls?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited October 2011
    How are you initialising otable1 and otable2? If you do something like this:

    [code]
    var otable1 = $('#table1').dataTable();
    var otable2 = $('#table2').dataTable();

    otable1.fnDraw();
    otable2.fnDraw();
    [/code]

    That will redraw first table 1 and then table 2.

    Allan
  • sangokusangoku Posts: 4Questions: 0Answers: 0
    I found the solution, the dumbo which is doing jscript for me (im a backend developer) didnt know what a global variable is.... he put in 2 on ready functions the 2 variables and toth tht htye are in the same domain ~~

    Thy for the effort anyway.
This discussion has been closed.