mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-12 21:10:24 +00:00
added props for more pagination customization (#19)
This commit is contained in:
committed by
Tanner Linsley
parent
19a0187720
commit
f195b3243d
@@ -2,7 +2,7 @@
|
||||
<a href="https://github.com/tannerlinsley/react-table"><img src="https://github.com/tannerlinsley/react-table/raw/master/media/Banner.png" alt="React Table Logo" style="width:450px;"/></a>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
# react-table
|
||||
@@ -99,7 +99,10 @@ These are the default props for the main react component `<ReactTable />`
|
||||
|
||||
// Text
|
||||
previousText: 'Previous',
|
||||
nextText: 'Next'
|
||||
nextText: 'Next',
|
||||
pageText: 'Page',
|
||||
ofText: 'of',
|
||||
rowsText: 'rows',
|
||||
|
||||
// Classes
|
||||
className: '-striped -highlight', // The most top level className for the component
|
||||
|
||||
@@ -54,6 +54,9 @@ export const ReactTableDefaults = {
|
||||
previousText: 'Previous',
|
||||
nextText: 'Next',
|
||||
loadingText: 'Loading...',
|
||||
pageText: 'Page',
|
||||
ofText: 'of',
|
||||
rowsText: 'rows',
|
||||
// Components
|
||||
tableComponent: (props) => <table {...props}>{props.children}</table>,
|
||||
theadComponent: (props) => <thead {...props}>{props.children}</thead>,
|
||||
@@ -428,6 +431,9 @@ export default React.createClass({
|
||||
canNext={canNext}
|
||||
previousText={this.props.previousText}
|
||||
nextText={this.props.nextText}
|
||||
pageText={this.props.pageText}
|
||||
ofText={this.props.ofText}
|
||||
rowsText={this.props.rowsText}
|
||||
previousComponent={PreviousComponent}
|
||||
nextComponent={NextComponent}
|
||||
//
|
||||
|
||||
+3
-3
@@ -63,7 +63,7 @@ export default React.createClass({
|
||||
</div>
|
||||
<div className='-center'>
|
||||
<span className='-pageInfo'>
|
||||
Page {showPageJump ? (
|
||||
{this.props.pageText} {showPageJump ? (
|
||||
<form className='-pageJump'
|
||||
onSubmit={this.applyPage}
|
||||
>
|
||||
@@ -83,7 +83,7 @@ export default React.createClass({
|
||||
</form>
|
||||
) : (
|
||||
<span className='-currentPage'>{currentPage + 1}</span>
|
||||
)} of <span className='-totalPages'>{pagesLength}</span>
|
||||
)} {this.props.ofText} <span className='-totalPages'>{pagesLength}</span>
|
||||
</span>
|
||||
{showPageSizeOptions && (
|
||||
<span className='select-wrap -pageSizeOptions'>
|
||||
@@ -96,7 +96,7 @@ export default React.createClass({
|
||||
<option
|
||||
key={i}
|
||||
value={option}>
|
||||
{option} rows
|
||||
{option} {this.props.rowsText}
|
||||
</option>
|
||||
)
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user