1

I do have a view with exposed filters and a quite hierarchical architecture of the data which demands multiple grouping and sorting criteria. because of different use cases, users need to change the the grouping/sorting which also changes the type of visualisation of the content (e.g. list & grid) example below.

this is easy realized with different displays, where I can keep the filter criteria and override the grouping and sorting behaviour.

what I need is an UI element that switches between the displays . of course I could reload the page with a new argument (display=grid) but this is bad UX so I need an ajax call where all user input is kept.

Grid example: ... GROUP BY Item.Type, Item.Color ORDER BY Item.Type ASC, Item.Color DEC, Item.id ASC

Type A.
    Color Z
        Item (id 4, Type A, Color Z)
        Item (id 5, Type A, Color Z)
        Item (id 9, Type A, Color Z)

    Color S
        Item (id 1, Type A, Color S)
        Item (id 2, Type A, Color S)
    Color B
        ...

Type B.
    Color Z
        Item (id 3, Type B, Color Z)
        Item (id 6, Type B, Color Z)
        Item (id 8, Type B, Color Z)
    Color M
        Item (id 7, Type B, Color M)
        Item (id 10, Type B, Color M)
    Color A
        ...

List example: ... GROUP BY Item.Color ORDER BY Item.Color ASC, Item.id ASC

    Color A
        ...
    Color B
        ...
    Color M
        Item (id 7, Type B, Color M)
        Item (id 10, Type B, Color M)
    Color S
        Item (id 1, Type A, Color S)
        Item (id 2, Type A, Color S)
    Color Z
        Item (id 3, Type B, Color Z)
        Item (id 4, Type A, Color Z)
        Item (id 5, Type A, Color Z)
        Item (id 6, Type B, Color Z)
        Item (id 8, Type B, Color Z)
        Item (id 9, Type A, Color Z)

side note: the view is implemented as a block because the page needs to be editable (through paragraphs)

edit: typo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.