Tabs and tables page to page

Tabs and tables page to page

KeesKees Posts: 3Questions: 0Answers: 0
edited August 2010 in General
Hello every one,

I really like the functions datatables give me but i could not find a solution to this.

On the home page there is a little place with tabs(different catagories), within the tabs you can enter a filter value like "i like cheese". (in this small spot there is no place for a big table that is why i switch pages)

So in this place i click on tab 2 enter "i like cheese" and press search.
Then i go to a new page with same tabs and the datatables with results.
I should then see the tab i selected active with "i like cheese" in the filter and the results below in the datatables.

I cant seem to get my head around it.

Greets, Kees

Replies

  • KeesKees Posts: 3Questions: 0Answers: 0
    edited August 2010
    Here i have the code that i use to enable tabs and Datatables

    [code]
    $(document).ready(function() {

    $("#tabs").tabs( { event: 'click', cookie:{ expires: 1 },
    "show": function(event, ui) {
    var oTable = $('div.dataTables_scrollBody>table.display', ui.panel).dataTable();

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


    $('table.display').dataTable( {

    "sDom": '<"top"fli>p<"wrapper"rt><"bottom"ip><"clear">',



    "sPaginationType": "full_numbers",
    "bPaginate": true,
    "bJQueryUI": true,
    "bStateSave": true,
    "aoColumnDefs": [
    { "aTargets": [ -1 ] }
    ]
    } );
    } );


    [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    So you want to filter the table in tab A, from tab B? You can use fnFilter to do this: http://datatables.net/api#fnFilter

    Allan
This discussion has been closed.