How to use multiple sources for several dataTables in one page ?

How to use multiple sources for several dataTables in one page ?

garcon1986garcon1986 Posts: 9Questions: 0Answers: 0
edited November 2009 in General
Hello all,

I want to use jquery dataTables to show something.

It works well when i just put one dataTable in

Replies

  • garcon1986garcon1986 Posts: 9Questions: 0Answers: 0
    I'm sorry, i have met a problem when i posted this question yesterday.

    I want to use jquery dataTables to show something.

    It works well when i just put one dataTable in one page, Then i add one more, but they occupied almost the same
    position, and one of them doesn't work well.

    I tried to solve it using two methods:
    1. i use two separate pages. Each page contains one working-well dataTable. Then i include the two pages using the third page.
    2. I use two tables in one page. Each table uses one dataTable, like the multi-tables in examples.

    http://datatables.net/examples/basic_init/multiple_tables.html

    Problem of the first method: The two tables almost occupy the same position and one table doesn't work.
    Problem of the second method: i can't use more [code]sAjaxSource[/code].

    Do you have solutions for the two problems?

    And for the second problem, can i use multiple `sAjaxSource` here. If yes, how to do that? If no, how to achieve that

    in another way?

    here is my code:

    [code
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi,

    If you have tables over lapping in the display then it sounds like you are having a CSS issue. Either floats of positioning would be my guess. Is the issue common across all browsers? Perhaps having a "play around" in Firebug might bring something to light.

    Regarding your question about multiple sAjaxSources - no you can only have on AjaxSource. You can change the source, but if you want to combine information from multiple sources you need to do that yourself using $.getJSON() or something like that.

    Regards,
    Allan
This discussion has been closed.