I have created a 2 level nested Mat-Table grid in Angular in which it can expand multiple rows at a time. On each row click from the parent grid it calls an API and loads the data for the inner grid.
When I click on the first row, it fetches the data as expected.
But when I click on the second row, it fetches the data for the second row as expected, but the value of the 1st inner row also becomes the same as the second one. The datasource value of the 1st row is overridden by the second one.
I tried making dataSource
an array of dataSource[i]
, using the index
, but I was unable to.
I have a working StackBlitz for my issue.
Can anyone help me on this? Thanks in advance.