How do you 'reference' master ag grid data in a detail grid

288 views Asked by At

Is it possible to use master/detail and expand a particular column to a detail grid (for readability purposes) using the same master data? i.e without having to make a second data fetch? I am using an enterprise version btw.

I've been trying to follow the example here and I can see how params.data.callRecords is being used to access child records for the detail grid, I'm trying to use the same method but with data that's already rendered in the parent grid:

My detail grid options currently look like this but nothing shows in the detail grid itself, even though I can debug and see the data in the console as well as access it if I reference it using a custom template.

detailGridOptions: {
 
 columnDefs: [
 {field: 'WIP_NARRATIVE' }, ],
                 
 defaultColDef: {
 flex: 1, },
               
   },               
 getDetailRowData: (params) = {
 setTimeout(function () {
 params.successCallback(params.data.WIP_NARRATIVE);
 1000);

Can anyone provide or point me to an example that demonstrates the proper way to do this? Is there a specific api call or callback method that I can use to get to this data without another full blown data fetch, as shown below and here?

getDetailRowData: (params) => {
    setTimeout(() => {
      this.http
        .get('...')
        .subscribe(data => {
          params.successCallback(data);
        });
    }, 500);

    // params.successCallback(params.data.callRecords);
  }
0

There are 0 answers