how datatable should hide a column with visible: false

how datatable should hide a column with visible: false

stwestwe Posts: 8Questions: 3Answers: 0
edited January 2015 in Free community support

Hi,

I'm the developer of the https://github.com/stwe/DatatablesBundle
There, I have an issue with visible = false.

Can you explain me how datatable should hide a column with visible: false (http://datatables.net/reference/option/columns.visible) ?

It puts a css class on column or somewhere ? or it does just create the dom for this column?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,892Questions: 1Answers: 10,144 Site admin
    Answer ✓

    Hi,

    DataTables will create the required cell, but it simply doesn't insert it into the document. I found that using CSS to hide cells was a recipe for performance and cross browser issues which is why DataTables only puts the nodes required into the document. The unused nodes are held in Javascript memory, and can be accessed using the API.

    Regards,
    Allan

  • stwestwe Posts: 8Questions: 3Answers: 0

    ok thanks for the reply. Is there a known issue with visible = false? In some cases, the columns are still displayed.

  • allanallan Posts: 61,892Questions: 1Answers: 10,144 Site admin

    ok thanks for the reply. Is there a known issue with visible = false?

    No. Can you link to a test case if you are having a problem with it please.

    The one common 'gotcha' is using Responsive with column visibility, since Responsive controls the column visibility. You can add the class never to a column if you never want it to be visible.

    Allan

This discussion has been closed.