jeudi 28 octobre 2021

Ag-grid row group based on two columns?

I have some rowdata with the following fields:

  • transaction id (unique)
  • price
  • contract start
  • contract end

Now my use case is, I want the top level row group based on active date. Given any calendar days, the contract is consider active on a particular date if it starts on or on that calendar day and ends after that calendar date.

The calendar date will be a user Input date. So they selected jan 1st to 2nd. I would want something like

  • 01/01/2021 (the row group)
    • id2/30/2020-12-30/2021-02-01
    • id5/50/2021-01-01/2022-01-02
  • 01/02/2021 (another row group)
    • id2/30/2020-12-30/2021-02-01 (because this is still active for this calendar date)
    • id10/100/2021-01-02/2021-01-10

It is also possible that the transaction has no end date (undefined). That just means the contract should be included on the row group of every calendar date from the start of the transaction.

How could I achieve this with ag grid?




Aucun commentaire:

Enregistrer un commentaire