Getting second header cell for hidden column

Getting second header cell for hidden column

ChickenCoderChickenCoder Posts: 4Questions: 0Answers: 0

When I use column().visible(), it removes column cells from the DOM. Since I need to iterate through all cells in a header row (visible or not), I've tried using column().header(). But that function only returns one the header cells. Is there a way I can retrieve all my header cells? It would be nice if I could do column(1).header(2), or something like that.

Currently I'm considering simply applying a class to the column cells to hide them instead of using column().visible(). This way I could iterate through them using the DOM. Is this the best approach?

Replies

  • ChickenCoderChickenCoder Posts: 4Questions: 0Answers: 0

    After implementing the changes to hide columns rather than removing them, I've found this causes issues with changes to column size, and erratic behavior of the ColReorder addon.

    So this brings me back to using column().visible() then. Does anyone know how to retrieve all headers associated with a column hidden using column().visible()?

  • ChickenCoderChickenCoder Posts: 4Questions: 0Answers: 0

    Please let me know if any of my wording needs further explanation. I apologize if anything I've written is unclear.

  • ChickenCoderChickenCoder Posts: 4Questions: 0Answers: 0

    In case it helps anyone else, I've found where to get the other header cells:
    settings.aoHeader[headerRow][column].cell

This discussion has been closed.