简体   繁体   中英

Building our own cellRenderer with grouping functionality in ag-grid

Previously I had columnDefs for rendering ag-grid cells without Angular Components with the built-in grouping functionality.

colDef = [
            {
                headerName: 'HeaderName',
                field: 'a',
                editable: false,
                cellRenderer: 'group',
                ...
            },

Now I tried to use Angular components to render ag-grid cells with cellRendererFramework but it made me lose my grouping functionality. The tree group values with expand / collapse functionality do not work anymore.

colDef = [
            {
                headerName: 'HeaderName',
                field: 'a',
                editable: false,
                cellRendererFramework: MyCustomCellRendererComponent,
                ...
            },

Do I need to set grouping manually?

I have also tried using groupRowInnerRenderer , innerRendererFramework .

I imagine you want to do something like the example at the bottom of this page . Basically all you need to change is this:

{
    headerName: 'HeaderName',
    field: 'a',
    editable: false,
    cellRenderer: 'group',
    cellRendererParams: {
        innerRendererFramework: MyCustomCellRendererComponent
    }
    ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM