Is it possible to have a "vertically-oriented" grid using ag-grid? (not pivot table)
Asked Answered
E

1

6

The default layout for a grid in ag-grid is what I call "horizontal" (with respect to the rows):

  • Columns are laid out vertically, spanning top-to-bottom.
  • Rows are laid out "across the columns", aka, spanning the horizon.
  • New rows get appended to the bottom.

Pictorially:
horizontal grid

I am needing grids to be "flipped" (aka, "vertical") in certain scenarios, such that:

  • Columns are laid out horizontally.
  • Rows are laid out vertically, spanning top-to-bottom.
  • New rows get appended to the right.

Pictorially:
vertical grid

Is this possible with ag-grid?
I don't think their pivot table will work for this, but maybe I'm not thinking creatively enough :)
These grids are being used in an Angular app.

Export answered 26/2, 2020 at 20:16 Comment(0)
D
1

Currently, the only solution is for you to write the transpose logic on your raw data and Column definitions by yourself.

Here is an excellent example and a video explainer to go along with it:

Demo: https://stackblitz.com/github/LMFinney/ag-grid-partial

Blog: https://blog.oasisdigital.com/2018/transposing-rows-and-columns-in-ag-grid/

Video: https://www.youtube.com/watch?v=1BR9sH7zG7g

Doubleripper answered 24/3, 2022 at 4:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.