AG-GRID: Concatenating two rows in one cell

Issue

In my code, I’m using AG-GRID for angular. I have two columns. One is Account.Name and the other is Account.Surname. I’m trying to display these two columns in one cell. I used the approach below but it did not work. What should I do to achieve what I want?

TS:

{ columnGroupShow: 'open', headerName: 'Requested Person', valueGetter: this.nameGetter },

nameGetter(params) {
    return params.ticket.Account.Name + ' ' + params.ticket.Account.Surname;
  }

Solution

Try this,

{ 
  columnGroupShow: 'open', 
  headerName: 'Requested Person', 
  valueGetter: function(params) {
    return params.ticket.Account.Name + ' ' + params.ticket.Account.Surname;
  }
},

Answered By – VKD

Answer Checked By – Terry (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.