2023.03.17(금)

전.study / / 2023. 3. 17. 18:24
728x90
const onRowClicked = (e: RowClickedEvent) => {
  gridApi?.redrawRows();
};
const rowStyle = (params: RowClassParams) => {
  if (params.api.getFocusedCell()?.rowIndex === params.rowIndex) {
    return { backgroundColor: 'yellow' };

  }
};
<AgGriedReact
  onGridReady={(event: GridReadyEvent) => setGridApi(event.api)}
  rowData={rowData}
  columnDefs={colDefs}
  suppressRowClickSelection={true}
  stopEditingWhenCellsLoseFocus={true}
  onRowClicked={onRowClicked}
  getRowStyle={rowtyle}
/>

row click 하면 row color 바뀌게

 

https://www.ag-grid.com/javascript-data-grid/view-refresh/

 

JavaScript Data Grid: View Refresh

The grid has change detection. Download v29 of the best JavaScript Data Grid in the world now.

www.ag-grid.com

https://www.ag-grid.com/react-data-grid/row-styles/

 

React Data Grid: Row Styles

Row customisation can be achieved in the following ways: Download v29 of the best React Data Grid in the world now.

www.ag-grid.com

 

반응형

'전.study' 카테고리의 다른 글

2023.05.19(금)  (0) 2023.05.19
2023.03.16(목)  (0) 2023.03.16
2023.03.13(월)  (0) 2023.03.13
2023.03.09(목)  (0) 2023.03.09
2023.02.09(목)  (0) 2023.02.09
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기