Active FixedColumns function of Datatable after first initialization

Active FixedColumns function of Datatable after first initialization

lelloravlellorav Posts: 3Questions: 1Answers: 0

Hi,

i should need that first istance of datatable start without fixedcolumn active. I want to active this function after another event. My question is: i have tried this one

new $.fn.dataTable.FixedColumns(currentTable, { iLeftColumns: 1 });

and it works, but it need that in first istance "ScrollX" is true but i need ScrollX equal false first time. So can i set "ScrollX: true" later??

Thank you

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin

    No - sorry. You would need to destroy the table (destroy or destroy()) and recreate the table. It cannot be dynamically enabled and disabled.

    Allan

  • lelloravlellorav Posts: 3Questions: 1Answers: 0

    Ok, thank you...i try to solve my issues in different way. Another question, is possible to "ask" to current istance of datatable if "Fixedcolumn" is active or not??

  • allanallan Posts: 63,819Questions: 1Answers: 10,517 Site admin
    Answer ✓

    Not a specific API, although you could use $( 'div.DTFC_ScrollWrapper', table.table().container() ).length > 0. If that is true then table is a FixedColumns table.

    Allan

  • lelloravlellorav Posts: 3Questions: 1Answers: 0

    Yes right, thank you!

This discussion has been closed.