mirror of
https://github.com/gosticks/react-table.git
synced 2026-09-21 08:30:39 +00:00
Introduced a 'multiSort' flag
Defaults to 'true' A 'false' value will turn multi-sort off.
This commit is contained in:
@@ -10,6 +10,8 @@ import '../../react-table.css'
|
||||
import Readme from './stories/Readme.js'
|
||||
import HOCReadme from './stories/HOCReadme.js'
|
||||
|
||||
// import Tester from './examples/expander';
|
||||
|
||||
// import { TreeTable, SelectTable, SelectTreeTable } from './examples/index'
|
||||
//
|
||||
// const exampleStories = [
|
||||
@@ -22,6 +24,8 @@ import HOCReadme from './stories/HOCReadme.js'
|
||||
const stories = [
|
||||
{ name: 'Readme', component: Readme },
|
||||
{ name: 'HOC Readme', component: HOCReadme },
|
||||
|
||||
// { name: 'Tester', component: Tester },
|
||||
|
||||
{ name: 'Simple Table', component: CodeSandbox('X6npLXPRW') },
|
||||
{
|
||||
|
||||
@@ -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