小编use*_*069的帖子

如何从 ag grid 中的单元格渲染器调用方法 - 创建了一个下拉单击事件而不是从选项触发?

这是我的 aggrid columndef

{
  headerName: 'Type Of Pin',
  field: 'pinType',
  width: 160,
  cellRenderer: this.typeOfPin,
  suppressSorting: true
}

typeOfPin(params) {
    console.log(params);
    // const eDiv = document.createElement('div');
    // const disableVal = true;
    // eDiv.innerHTML =
    return  '<div><select placeholder="Select" class="form-control ag-form-control">' +
      '<option></option>' +
      '<option (click)="test()" selected>Number</option>' +
      '<option onClick="test()" >Random</option>' +
      '</select></div>';
}
Run Code Online (Sandbox Code Playgroud)
{
  headerName: 'Type Of Pin',
  field: 'pinType',
  width: 160,
  cellRenderer: this.typeOfPin,
  suppressSorting: true
}

typeOfPin(params) {
    console.log(params);
    // const eDiv = document.createElement('div');
    // const disableVal = true;
    // eDiv.innerHTML …
Run Code Online (Sandbox Code Playgroud)

typescript ag-grid angular

1
推荐指数
1
解决办法
4817
查看次数

标签 统计

ag-grid ×1

angular ×1

typescript ×1