Clickable url value in ag-grid with react

后端 未结 2 938
说谎
说谎 2021-01-17 23:47

I\'m currently giving ag-grid a try and trying to build a table where if the user clicks a column value, they are taken to a page containing that entry\'s details.

<

2条回答
  •  天涯浪人
    2021-01-18 00:45

    Since you've already used React, you should use frameworkComponent instead. Somebody mentioned about the overhead of React but because this is a very simple component, I do not think it matters much in this case.

    Anyway, here is the example setup.

    function LinkComponent(props: ICellRendererParams) {
      return (
        
          {props.value}
        
      );
    }
    
    ...
    
    // in your render method
    
    

    Live Example

提交回复
热议问题