Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to copy the values present in ag-grid

I am using ag-grid to bind values from a list, Is it possible to copy the value/data in the selected cell. I have tried to copy the value using ctrl+c but its not working is there any other way?

Please help me!

like image 753
durai Avatar asked Mar 01 '16 11:03

durai


People also ask

How to copy cell value ag grid?

Cells can be copied by dragging a range with the mouse and hitting Ctrl + C . When cells are pasted from the clipboard, values are prefixed with 'Z-'. Cells can be pasted by hitting Ctrl + V .

How do you copy text on Ag grid?

Select 'Copy' from the context menu that appears when you right click over a cell. Press keys Ctrl+C while focus is on the grid.

How do you get the data of the selected row in Ag grid in react?

selectionChanged. Row selection is changed. Use the grid API getSelectedNodes() or getSelectedRows() to get the new list of selected nodes / row data.


2 Answers

There is a flag which will allow you to select text and then CTRL+C will work.

enableCellTextSelection=true

This is not an enterprise config and can be at any time to enable cell text selection.

like image 134
Vladi Avatar answered Sep 18 '22 11:09

Vladi


You can do this using CSS below:

.ag-font-style {
  user-select: initial;
  -moz-user-select: text;
  -ms-user-select: text;
  -webkit-user-select: text;
}

This should work in any of the browsers viz IE, Chrome, Mozilla and may be Safari.

like image 43
Vinod Tanguturi Avatar answered Sep 18 '22 11:09

Vinod Tanguturi