Skip to content

Commit

Permalink
Start row count on 1 instead of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ohmyguigs committed Jun 20, 2018
1 parent 94276b8 commit 0f28207
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions react/components/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ class Table extends PureComponent {
const properties = Object.keys(schema.properties)
// hydrate items with index when 'indexColumn' prop is true
const newItems = indexColumn
? items.map((item, index) => {
return { ...item, _reactVirtualizedIndex: index }
})
? items.map((item, index) => ({
...item,
_reactVirtualizedIndex: index + 1,
}))
: items
return (
<div className="vh-50">
Expand Down Expand Up @@ -52,7 +53,8 @@ class Table extends PureComponent {
>
{indexColumn ? (
<Column
headerRenderer={() => <React.Fragment>Index</React.Fragment>}
headerRenderer={() => <span className="ph4">Index</span>}
cellRenderer={({ cellData }) => <span className="ph4">{cellData}</span>}
dataKey="_reactVirtualizedIndex"
label={indexColumnLabel}
width={width / 10} // 10%
Expand Down

0 comments on commit 0f28207

Please sign in to comment.