DataTables UI Tabs and AJAX

DataTables UI Tabs and AJAX

jprjpr Posts: 5Questions: 0Answers: 0
edited November 2010 in General
Hello Allan,

I'm trying to use both datatables with server side processing and UI tabs with Ajax.
So First my UI Tabs are loaded with AJAX like this
[code]


Employ

Replies

  • jprjpr Posts: 5Questions: 0Answers: 0
    Nobody can help me on this

    Regards,
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    What is the JSON data that is being sent back that Firefox is giving a warning about? Can you link us to an example?

    Allan
  • jprjpr Posts: 5Questions: 0Answers: 0
    Hi Allan

    I managed to get rid of my json error.

    I use this code

    [code]
    $(document).ready(function() {
    $("#tabs").tabs( {
    "show": function(event, ui) {
    var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();

    if ( oTable.length > 0 ) {
    oTable.fnAdjustColumnSizing();
    }
    }
    } );

    $('table.display').dataTable( {
    "bJQueryUI": true,
    "sScrollY": "400",
    "sScrollX": "100%",
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "tables.php"
    } );
    } );

    [/code]

    Is it possible to modify the ajaxsource in relation of the active tab ? I mean is there a way to add a parameter to the ajax source depending which tab is active ?

    I want in each tab to display diferent data from different tables.

    Thank you again for your help and ideas ;-)

    Regards

    JP
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The way you have it at the moment, you are using the same sAjaxSource for all tables matching the selector. What you would need to do is initialise each table individually with the sAjaxSource that you want for each table. You could possibly use $.extend() and a function to make this a little easier :-)

    Allan
This discussion has been closed.