Dan Hoff
Dan Hoff

Reputation: 45

Vue Ag-grid - cellRendererFramework: passing down props

I'm creating some ag-grids for an Vue application and one of the columns requires a reusable component to be rendered with a prop passed down to it. Using cellRendererFramework (as cellRenderer doesn't work with Vue as far as I understand it) There doesn't seem to be a cellRendererFrameworkParams option like cellRendererParams.

columnDefs: [
    {
        headerName: 'Column header',
        field: 'field',
        cellRendererFramework: Vue.extend(reusableComponent),
        cellRendererFrameworkParams: { reusableComponentProp: 'test' } // this throws a warning message shown below 
    }
],

Warning message:

ag-grid: invalid colDef property 'cellRendererFrameworkParams' did you mean any of these: cellRendererFramework,cellRendererParams,pinnedRowCellRendererFramework,pinnedRowCellRendererParams,cellRenderer,cellRenderer,cellRendererSelector,cellEditorFramework

On the basis of that, cellRendererFrameworkParams doesn't exist, So does anyone know of a nice work around?

Thanks in advance

Upvotes: 2

Views: 3487

Answers (1)

Mihail C
Mihail C

Reputation: 56

Instead of using cellRendererFrameworkParams try using cellRendererParams. Then in your component reusableComponent, you can access the reusableComponentProp param via this.params (e.g. this.params.reusableComponentProp).

Upvotes: 4

Related Questions