ag-grid / ag-grid-vue-example

Example of using ag-Grid with Vue
134 stars 68 forks source link

Is it possible to fit two components in a single columns? #10

Closed vyasnikul closed 4 years ago

vyasnikul commented 6 years ago

beforeMount () { this.columnDefs = [ {headerName: 'Actions', field: 'action', cellRendererFramework: 'GridEditButton', cellRendererFramework: 'GridDeleteButton'}, {headerName: 'SrNo', field: 'srno'}, {headerName: 'KeyValue', field: 'keyvalue'}, {headerName: 'ObjectID', field: '_id'} ]; this.rowData = [ {action: '', srno: 0, keyvalue: 'Toyota', _id: 'Celica'}, {action: '', srno: 1, keyvalue: 'Honda', _id: 'Civic'}, {action: '', srno: 2, keyvalue: 'Chevy', _id: 'Impala'} ]; },

A sample before mount function with two components in the first column. But it will give error of duplicate cellRendererFramework.

seanlandsman commented 4 years ago

You cannot have two cellRenderers in a column - if you want this sort of thing I'd suggest creating a composite renderer that encompasses other components and just render the parent component