Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy cell feature with complex object

I am using complex object to render ag-grid column.

Employee Name(street)

John (st. lucy One)

John (st. lucy Two)

For example this is json:

  { 
      "employee":[
        "name": "John", 
        "address":[
           {
            "street":"st. lucy One",
            "postalcode":"jkjkjk"
             ....
           },
           {
            "street":"st. lucy Two",
            "postalcode":"jkjkjk"
             ....
           }
         ]
       ]
    }

ag-grid column description:

 {
        headerName: "Employee",
        field: "employee",
        cellRenderer: EmployeeComponent // Render HTML from component to display name & street in Employee Name(street) Column
 }

I am able to render HTML into cell.

Problem: However, it broke the feature of coping by right clicking on the Employee Name(street) cell. When I copy cell it copies Object [object] (which is I think is employee object) but not able to copy Employee Name(street) text.

Any help will be appreciated.

like image 746
user2985842 Avatar asked Mar 15 '26 04:03

user2985842


1 Answers

I had exactly this problem and I managed to get it working by using the code from this answer:

https://stackoverflow.com/a/56597441/3018671

like image 120
NicuVlad Avatar answered Mar 18 '26 02:03

NicuVlad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!