Can I group and hide columns "excel-like"?

Can I group and hide columns "excel-like"?

DanielAguadoDanielAguado Posts: 2Questions: 1Answers: 0

Hi everyone,

I've been strugeling for more than 8 hours with this until now so I have decided to write here to see if someone can give me a hand instead of losing more time... because maybe it's not posible.

I have a huge table (very long), which is group on the header using col-spans. I'm adapting an Excel software to web, and DataTables has been a must for me due to it's filter and ordering capabilities, which are awesome.

I'm been requested by the client to have this functionality on the table:

I can get the colspan from the header, I have this number on the code. I have tried with the Buttons Extension but the client is not accepting this solution. Have tried with CSS and have no success on it.

Hope someone can help or have deal with this before.

Best regards,

Daniel

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @DanielAguado ,

    Can you give more information on what you want there, please. For example, when you say "group columns", is that just under a colspan header or do you want the contents to merge too? Likewise hiding columns, how do you expect that to work? Colvis button offers that - what doesn't the client like about that?

    Cheers,

    Colin

  • DanielAguadoDanielAguado Posts: 2Questions: 1Answers: 0

    Hi @colin ,

    The behaviour the client is expecting is the same as in excel: the icons are over the headers of each section and not in a button at the start of the table. I told him the functionality is exactly the same, but he say no, he want it like excel...

    The table represent a lineal process and they want the toggles to be on their original position on that lineal process.

    The column grouping is given by the header colspan. I have created a little example of the table on Excel so you can see what I'm looking for.

    I need to collapse each column below the yellow headers:

    I can add a column visibility toggle on the cells (or at least try to) but when the header is hidden I won't be able to show that + over the table like excel does.

    I know it is a bit complex, or too much complex maybe, but when you deal with clients with this you have no other choice...

    Hope you can help,

    Best regards,
    Dani

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @DanielAguado ,

    The header wouldn't be a problem - see an example of complex headers here.

    I'm not sure how the visibility toggle would work - click to hide is easy, but not sure what you would then click to make it visible again. You could possibly add a double-click handler to the headers which would make hidden neighbouring columns reappear.

    Cheers,

    Colin

This discussion has been closed.