getColumns, move columns

Tags: #<Tag:0x00007efc609f6100>

Hi,

I have a few questions.

  1. I know there is the getColHeader() function to get the column headers, but I would also like to know if there is also like a getHeader() function to get the header itself, I need this to get the type and sources for example.
  2. As you can see in my fiddle, I have hidden columns and when I click the “show hidden columns” button, it shows the hidden column but it shows in the original position I have set it to. My question is, is there a way to show the hidden column at the end of the table rather than it’s original position.
  3. When I move a column, the header stays as ABC…L but the data changes to ABF…L for example. Is there a way to move the headers too?

For reference, here is my fiddle
https://jsfiddle.net/namihihii/3m48yr19/3/

Sorry if it’s a lot.

Thank you!

Hi @namihihii

  1. No, there are only getColHeader() or getRowHeader() functions;
  2. That’s possible, but you have to also use moveColumns() method: https://jsfiddle.net/aszymanski/L0dtvmqc/

But this solution will move only the columns content, not headers. It used to work like that but many versions ago it was decided to change that behavior. I believe it also answers your third question as it’s the same plugin responsible for that.

Hi,

Thank you for the help. I was able to accomplish what I was trying to achieve.
Have a great day! :slight_smile:

@namihihii

That’s great! I will close this topic then.