FixedHeader table is created at the bottom of the webpage and not working

FixedHeader table is created at the bottom of the webpage and not working

sakubaisakubai Posts: 1Questions: 1Answers: 0

I am new to jQuery and this DataTables plugin is really great. It had changed my whole website look.

Many thanks to the creators!!! Good job!

I have a problem with FixedHeader. I am not sure if I am doing it right.. the table is created without any issues.

But the problem is that the FixedHeader table with cloned class is created at the bottom of the page without the tbody elements inside and the <thead> elements also move up to the window top, instead of page top.

This is my code..

$(document).ready(function() {

    var table = $('table.display').DataTable({  

    dom: '<lf<t>ip>',                       
            "columnDefs": [ { type: 'date-uk', "targets": 5 } ] ,          
    "order": [[ 0, 'asc' ]],        
    "paging":false,                                       
    language: {  "sSearch": "Filter records:", "sSearchPlaceholder": "Keywords..." }
    ,
    "fnInitComplete": function () {
        var api = this.api();       
        api.$('td').click( function () {
            api.search( this.textContent ).draw();
        } );
    }
    ,
    "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull) {
        var oSettings = this.fnSettings();
        var str = oSettings.oPreviousSearch.sSearch;
        var cache = oSettings.oPreviousSearch.oSearchCaches;
        var z= aData.length;       
        var api = this.api();      
        var searchStrings = [];
    if (str != "")
    {
        searchStrings.push(str);
    }    
        $('td', nRow).each( function (i) {  


                    this.innerHTML = aData[i].replace( new RegExp( str, 'i'), function(matched) {
                        return "<span class='filterMatches'>"+matched+"</span>";
                    });


        } );
        return nRow;            
    }

    } ); 

    new $.fn.dataTable.FixedHeader( $("#example") );

} );  

I am using DataTables version 1.10.4 and FixedHeader v2.1.2

I would highly appreciate it if anyone could help me with this.

This discussion has been closed.