Button to change view table->grouping->table

Hello.
I have a page with table.
I want insert button in page (not table), which will change view of table to groupped and without groupped.

How can i do this?

p.s. I found this topic Sort / group table with external controls by @Paul_Danyliuk, but in second action i want to ungroup table for normal (default) view. I think i may duplicate column for grouping, but i will use view of this table in another page, and because of this i dont want duplicate column

Hi @dezvin,
and welcome to Coda community :handshake:

You actually can’t provide this kind of automatic switch. i.e. buttons can perform actions on data, but not change the layout.

You can however create two separate views and use links to different views.
Something like this:

It’s a workaround, but maybe it accomplishes what you need.

Let me know!

3 Likes

It`s so simple! Thank you!

1 Like

@dezvin, I had the exact same question this evening (which prompted me to search the forum and found your post). I used a similar solution, but rather than using links, I made the tables collapsing. It looks like this:
toggles

1 Like