Hide a column

Hide a column

melcasmelcas Posts: 3Questions: 1Answers: 0

Hello,
I'm trying to hide the first column of my datatable. I don't need to display that information in that column but I need to consult for certain functions with javascript. My trouble is when I use the attribute:
"columnDefs": [ { "targets": [ 0 ], "visible": false }
the column also remove of HTML DOM and I don't want that.
I already tried hidding with CSS but it's not working.
I would be really grateful if someone help me with this, please!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,812Questions: 1Answers: 10,516 Site admin
    Answer ✓

    Just use row().data() to get the data for the row (regardless of column visibility).

    Allan

  • melcasmelcas Posts: 3Questions: 1Answers: 0

    Thank you, Allan :)

  • melcasmelcas Posts: 3Questions: 1Answers: 0

    Hi Allan,
    I'll try the method that you suggested but I couldn't get the data from the column. :(

  • allanallan Posts: 63,812Questions: 1Answers: 10,516 Site admin

    I'd need a link to a page showing the issue to be able to offer any assistance with resolving it.

    Allan

This discussion has been closed.