Compare commits

...
3 Commits
Author SHA1 Message Date
Tanner Linsley 8bff135119 2.1.2 2016-10-25 23:37:05 -06:00
Tanner Linsley e930d834c6 Fixed index to point to original index, added viewIndex 2016-10-25 23:36:59 -06:00
Tanner Linsley 7700f6a1a0 Standard ignore lib 2016-10-25 17:07:09 -06:00
5 changed files with 15 additions and 10 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ Or just define them on the component
className: '', // Set the classname of the `th/td` element of the column
innerClassName: '', // Set the classname of the `.th-inner/.td-inner` element of the column
columns: [...] // See Header Groups section below
render: JSX eg. ({row, value, index}) => <span>{value}</span>, // Provide a JSX element or stateless function to render whatever you want as the column's cell with access to the entire row
render: JSX eg. ({row, value, index, viewIndex}) => <span>{value}</span>, // Provide a JSX element or stateless function to render whatever you want as the column's cell with access to the entire row
sortable: true,
sort: 'asc' or 'desc',
show: true,
+6 -4
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "2.1.1",
"version": "2.1.2",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
@@ -52,6 +52,7 @@
"ignore": [
"node_modules",
"dist",
"lib",
"example",
"react-table.js"
]
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -3
View File
@@ -196,9 +196,10 @@ export default React.createClass({
}
},
accessData (data) {
return data.map((d) => {
return data.map((d, i) => {
const row = {
__original: d
__original: d,
__index: i
}
this.decoratedColumns.forEach(column => {
row[column.id] = column.accessor(d)
@@ -337,7 +338,8 @@ export default React.createClass({
<Cell
value={row[column.id]}
row={row.__original}
index={i}
index={row.__index}
viewIndex={i}
/>
) : typeof Cell !== 'undefined' ? Cell
: row[column.id]}