facebookarchive / fixed-data-table

A React table component designed to allow presenting thousands of rows of data.
http://facebook.github.io/fixed-data-table/
Other
4.3k stars 553 forks source link

Question: how to highlight row selection? #442

Closed kayazinc closed 8 years ago

kayazinc commented 8 years ago

Use-case

  1. User clicks on the cell on the table.
  2. The row on the table is highlighted.

I tried the solution on https://github.com/facebook/fixed-data-table/issues/189 and the following is the result: watchlist-row-highlighter

See the blue circle, there is a empty "space". Is there anyway to fill the entire row, i.e. fill the empty space too?

csatish commented 8 years ago

@kayazinc Can you please share some code to show selection highlight?

kayazinc commented 8 years ago

@csatish, at cell definition, you can set the style.

const DateCell = ({rowIndex, data, col, ...props}) => (
  <Cell {...props} className="highlight">  // set the highlight style
    {data.getObjectAt(rowIndex)[col].toLocaleString()}
  </Cell>
);
varenya commented 7 years ago

Cell class applies at cell not the row level right? @kayazinc

Dhruv56 commented 7 years ago

You can use rowClassNameGetter to apply class on a Row. Refer to documentation for more details @varenya

varenya commented 7 years ago

I tried that but it works on cell only...

undejavue commented 6 years ago

+1, want to highlight whole row on hover; no success (

rahadian347 commented 6 years ago

i can't use rowClassNameGetter to change row's background color , it'cant change row's background color, only cell background, any idea ?