mirror of
https://github.com/gosticks/react-table.git
synced 2026-10-06 15:57:04 +00:00
Introduced a 'multiSort' flag
Defaults to 'true' A 'false' value will turn multi-sort off.
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import ReactTable from '../../../../lib/index'
|
||||
import '../../../../react-table.css'
|
||||
|
||||
const data = [
|
||||
{one:"1.1",two:"1.2"},
|
||||
{one:"2.1",two:"2.2"},
|
||||
{one:"3.1",two:"3.2"},
|
||||
{one:"4.1",two:"4.2"},
|
||||
]
|
||||
|
||||
const columns = [
|
||||
{accessor:'one', Header: 'One'},
|
||||
{accessor:'two', Header: 'Two'},
|
||||
]
|
||||
|
||||
class ExpanderComponent extends React.Component {
|
||||
render()
|
||||
{
|
||||
return (
|
||||
<div className={`rt-expander ${this.props.isExpanded ? '-open' : ''}`}>
|
||||
•
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class SubComponent extends React.Component {
|
||||
render()
|
||||
{
|
||||
return <div>Nothing</div>
|
||||
}
|
||||
}
|
||||
|
||||
export default class ComponentTest extends React.Component {
|
||||
render()
|
||||
{
|
||||
const rtProps = {
|
||||
data,
|
||||
columns,
|
||||
ExpanderComponent: (props)=><ExpanderComponent {...props} />,
|
||||
SubComponent: (props)=><SubComponent {...props} />,
|
||||
multiSort: false,
|
||||
}
|
||||
return (
|
||||
<ReactTable
|
||||
{...rtProps}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user