0

I am trying to set up an ag-grid so a user can click on one more more rows and then Ctrl + C to select all the data. Looking at this site https://www.ag-grid.com/angular-grid/row-selection/ it looks like Row Selection is part of the community edition but I've been trying to implement it for days using the various examples and just cannot get it to work. I've been finding conflicting answers as to whether this feature is available.

The first 2 grids on the above link do not have enterprise imported and I am noticing you cannot copy the rows to clipboard. The following grids DO have enterprise imported and DO allow for copying to clipboard. Does Row Selection for community simply mean the ability to select a row and not necessarily copy its data?

Here is the grid.

<ag-grid-angular
                    #agGrid
                    style="width: 100%; height: 340px;"
                    id="myGrid"
                    class="ag-theme-balham"
                    [rowData]="rowData"
                    [gridOptions]="apiGlob.gridOptions"
                    [columnDefs]="colDefs"
                    (columnMoved)="apiGlob.onColumnMoved($event, agGridColNm[localSearchCriteria])"
                    (columnPivotChanged)="apiGlob.onColumnMoved($event, agGridColNm[localSearchCriteria])"
                    (columnResized)="apiGlob.onColumnResized($event, agGridColNm[localSearchCriteria])"
                    (columnVisible)="apiGlob.onColumnVisible($event)"
                    (gridReady)="apiGlob.onGridReady($event, agGridColNm[localSearchCriteria])"
                    [overlayNoRowsTemplate]="apiGlob.noRowsTemplate"
                >
                </ag-grid-angular>

And here is the gridOptions

gridOptions = <GridOptions>{
        defaultColDef: {
            flex: 1,
            wrapText: true,
            autoHeight: true,
            resizable: true,
            sortable: true,
            groupHeaders: true,
            filter: 'agTextColumnFilter',
        },
        rowSelection: 'multiple'
    };

Is this feature available for community or is it enterprise only?

1 Answers1

0

It looks like this is an enterprise feature based on this page: https://www.ag-grid.com/angular-grid/clipboard/

I created a basic Stackblitz using AgGrid community version to copy rows to clipboard. It uses the Ag-Grid API to get the selected rows and copies it to clipboard using a textarea.

  • I use a button, but you can always listen to keybind (Ctrl + C), use preventDefault(), and instead go through the copy to clipboard code like above. – Sahil Patel Jul 13 '21 at 03:11