mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-19 08:20:30 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6d03673ff | ||
|
|
c3fc84db01 | ||
|
|
3334796223 | ||
|
|
92b70393fa | ||
|
|
efeabe3536 | ||
|
|
f018bac58f | ||
|
|
a8f360a408 |
@@ -151,7 +151,12 @@ Every React-Table instance requires a `columns` prop, which is an array of objec
|
||||
style: {}, // Set the style of the `td` element of the column
|
||||
innerClassName: '', // Set the classname of the `.-td-inner` element of the column
|
||||
innerStyle: {}, // Set the style of the `.-td-inner` element of the column
|
||||
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
|
||||
render: JSX eg. ({value, rowValues, row, 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
|
||||
// value == the accessed value of the column
|
||||
// rowValues == an object of all of the accessed values for the row
|
||||
// row == the original row of data supplied to the table
|
||||
// index == the original index of the data supplied to the table
|
||||
// viewIndex == the index of the row in the current page
|
||||
|
||||
// Header & HeaderGroup Options
|
||||
header: 'Header Name' or JSX eg. ({data, column}) => <div>Header Name</div>,
|
||||
|
||||
Vendored
+16
-10
File diff suppressed because one or more lines are too long
@@ -21,7 +21,8 @@ export default Component({
|
||||
accessor: 'firstName'
|
||||
}, {
|
||||
header: 'Last Name',
|
||||
accessor: 'lastName'
|
||||
id: 'lastName',
|
||||
accessor: d => d.lastName
|
||||
}]
|
||||
}, {
|
||||
header: 'Info',
|
||||
|
||||
-709
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-table",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.6",
|
||||
"description": "A fast, lightweight, opinionated table and datagrid built on React",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/tannerlinsley/react-table#readme",
|
||||
|
||||
File diff suppressed because one or more lines are too long
Vendored
-7
File diff suppressed because one or more lines are too long
+7
-4
@@ -126,12 +126,14 @@ export default React.createClass({
|
||||
return dcol
|
||||
}
|
||||
|
||||
if (dcol.accessor && !dcol.id) {
|
||||
if (!dcol.accessor) {
|
||||
dcol.accessor = d => undefined
|
||||
}
|
||||
if (!dcol.id) {
|
||||
console.warn(dcol)
|
||||
throw new Error('A column id is required if using a non-string accessor for column above.')
|
||||
}
|
||||
|
||||
dcol.accessor = d => undefined
|
||||
return dcol
|
||||
}
|
||||
|
||||
@@ -372,6 +374,7 @@ export default React.createClass({
|
||||
{pageRows.map((row, i) => {
|
||||
const rowInfo = {
|
||||
row: row.__original,
|
||||
rowValues: row,
|
||||
index: row.__index,
|
||||
viewIndex: i
|
||||
}
|
||||
@@ -398,11 +401,11 @@ export default React.createClass({
|
||||
>
|
||||
{typeof Cell === 'function' ? (
|
||||
<Cell
|
||||
value={rowInfo[column.id]}
|
||||
{...rowInfo}
|
||||
value={rowInfo.rowValues[column.id]}
|
||||
/>
|
||||
) : typeof Cell !== 'undefined' ? Cell
|
||||
: rowInfo[column.id]}
|
||||
: rowInfo.rowValues[column.id]}
|
||||
</div>
|
||||
</TdComponent>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user