簡體   English   中英

如何在 Ag-grid 上渲染反應元素

[英]How to render react elements on Ag-grid

嘿,我試圖在 ag 網格上渲染反應節點,但它似乎無法正常工作

這是我嘗試過的:

{
     headerName: 'countries',
     field: 'country',
     render: () => (
       <Icon
         type="eye"
         style={{ fontSize: '20px', cursor: 'pointer' }}
         onClick={() => this.props.setMachineModal(true)}
       />
     ),
   }

如此簡單,只需使用 cellRendererFramework

{
     headerName: 'countries',
     field: 'country',
     cellRendererFramework: () => (
       <Icon
         type="eye"
         style={{ fontSize: '20px', cursor: 'pointer' }}
         onClick={() => this.props.setMachineModal(true)}
       />
     ),
   }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM