Buttons and scrollX - adjusting column width with column visibility

Buttons and scrollX - adjusting column width with column visibility

jazjaz Posts: 16Questions: 3Answers: 0

Debugger code: abaday

I have implemented Buttons, using the colvisGroup extension. Different groups of columns are shown and hid when the buttons are clicked. Also,
stateSave: true
so the column visibility is saved for the user.

Unfortunately, the table doesn't resize correctly. The scrollx option creates a table that is just a smidge too big so I end up with a scrollbar for every table, no matter which columns are visible. The table will resize correctly when I choose the different column visibilities, but the table always has that extra few pixels that put a scollbar in when it isn't required. If I set scrollx: false, the initial table load works well. However, the table doesn't resize as the column visibility is changed.

I've tried messing around with creating custom actions for each button. The only thing that works that I've found is to call
dt.columns.adjust().draw()
. Unfortunately, this creates a new ajax call to the server and I'd rather not do that unless absolutely necessary.

Any thoughts? What other information would be helpful to include to be able to find a solution?

Thanks!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,099Questions: 1Answers: 10,183 Site admin
    Answer ✓

    Can you give a link to the page so I can debug it please? Unfortunately the debugged doing give everything that would be needed to debug this - live debugging would be required.

    Allan

This discussion has been closed.