How to know fixed columns status?

How to know fixed columns status?

dorucciadoruccia Posts: 4Questions: 2Answers: 0

I have a button to switch the fixed columns, but I can't read the status.

I need some criteria that that I could encapsulate in a function "areColumnFixed".
I couldn't find anything in te API reference.

I found this:

if ($("#tbl_data").DataTable().context[0]._oFixedColumns) {
    // status is "columns fixed"
    ...
}

but it's reallu ugly, and anyway it does not work always.
Some suggest?

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @doruccia ,

    There's isn't an API method to get that information unfortunately. You could always make a note of the columns you passed into the initialisation and refer back to that, or possibly check the columns in the wrappers (.DTFC_LeftHeadWrapper and `.DTFC_RightHeadWrapper), but neither are particularly elegant I'm afraid.

    Cheers,
    .
    Colin

  • dorucciadoruccia Posts: 4Questions: 2Answers: 0

    Thank you Colin.

This discussion has been closed.