Faizan Saiyed
Faizan Saiyed

Reputation: 852

How to update ALL detail grids columnDef in AG Grid master detail view?

I have the latest enterprise edition of Ag-Grid in the Angular app. I've server-side data rendered in Ag-Gird master detail view. Also, I've implemented the save table state for both master & detail grids but the issue is, that when I hide some columns from the detail grid of one row, it does not update the detail grid for other rows. How can I update that to reflect on every detail grid?

problem-illustration

Upvotes: 0

Views: 235

Answers (1)

Faizan Saiyed
Faizan Saiyed

Reputation: 852

I've achieved it using the gridReady option of the detail grid:

onGridReady: e => {
        const state = this.paymentsColApi?.getColumnState();
        if (state) {
          e.columnApi.applyColumnState({
            state: state,
            applyOrder: true
          });
        }
        this.paymentsGridApi = e.api;
        this.paymentsColApi = e.columnApi;
        if (this.isFirstTimePaymentsGridLoad) {
          this.restorePaymentsGrid();
        }
      }

Upvotes: 0

Related Questions