简体   繁体   English

AG-GRID:在一个单元格中连接两行

[英]AG-GRID: Concatenating two rows in one cell

In my code, I'm using AG-GRID for angular.在我的代码中,我将 AG-GRID 用于角度。 I have two columns.我有两列。 One is Account.Name and the other is Account.Surname.一个是 Account.Name,另一个是 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: TS:

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

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

Try this,尝试这个,

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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