Fixed header set previous table columns to show.

Fixed header set previous table columns to show.

Dhaval PatelDhaval Patel Posts: 2Questions: 1Answers: 0

Hello ,

I have used DataTable with coulmnfilter and fixedheader. working fine with single table. but when i used it for multiple table

in tabing it shows earlier columns in fixed header. Here is my code.

For Table1 :

var $Table1 = $('#Table1').dataTable({
iDisplayLength: 100,
fixedHeader: true
}).columnFilter({
sPlaceHolder: "head:after",
aoColumns: [{
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}],
});

For Table2:

var $Table2 = $('#Table2').dataTable({
iDisplayLength: 100,
fixedHeader: true
}).columnFilter({
sPlaceHolder: "head:after",
aoColumns: [{
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}, {
type: 'text'
}],
});

When i put Table1 in seprate page it works fine. But when i used two tables in tow different tab in single page, Fixed header displays Table1 columns where it has to show table2 columns in fixed header.

Answers

  • Dhaval PatelDhaval Patel Posts: 2Questions: 1Answers: 0

    I have also used

    new $.fn.dataTable.FixedHeader($Table1, {
    top: true
    });

This discussion has been closed.