-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nathan Trost
authored and
Nathan Trost
committed
May 6, 2016
1 parent
0f5b44b
commit 4ba1745
Showing
15 changed files
with
457 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,4 +72,4 @@ | |
"jQuery": true, | ||
"$": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
//Griddle Components | ||
import Griddle from 'griddle-react'; | ||
|
||
class GriddleCustomHeader extends React.Component{ | ||
constructor(props){ | ||
super(props); | ||
} | ||
|
||
render(){ | ||
return( | ||
<span className="griddle__header"> | ||
{this.props.displayName} | ||
</span> | ||
); | ||
} | ||
} | ||
GriddleCustomHeader.propTypes = { | ||
rowData: React.PropTypes.object, | ||
displayName: React.PropTypes.string | ||
}; | ||
|
||
|
||
export default GriddleCustomHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
//Griddle Components | ||
import Griddle from 'griddle-react'; | ||
|
||
//Bootstrap Components | ||
import { Pagination, Glyphicon } from 'react-bootstrap'; | ||
|
||
class GriddleCustomPager extends React.Component{ | ||
constructor(props){ | ||
super(props); | ||
this.handleSelect = this.handleSelect.bind(this); | ||
this.state = { | ||
activePage: 1 | ||
}; | ||
} | ||
|
||
getPrev() { | ||
if (this.props.currentPage > 0) { | ||
return ( | ||
<span className="previous"> | ||
<Glyphicon glyph="chevron-left"/> | ||
{this.props.previousText} | ||
</span> | ||
); | ||
} | ||
} | ||
|
||
getNext(){ | ||
if(this.props.currentPage != (this.props.maxPage -1)){ | ||
return( | ||
<span className="next"> | ||
{this.props.nextText} | ||
<Glyphicon glyph="chevron-right" /> | ||
</span> | ||
); | ||
} | ||
} | ||
|
||
handleSelect(eventKey) { | ||
const maxPage = this.props.maxPage; | ||
const page = eventKey; | ||
|
||
if(page > maxPage || !page) | ||
return; | ||
this.props.setPage(page-1); | ||
} | ||
|
||
render(){ | ||
const maxPage = this.props.maxPage; | ||
const pagerBsSize = this.props.pagerBsSize; | ||
|
||
if (maxPage < 2) { return <span />; } | ||
|
||
return ( | ||
<div className="griddle__pagination-container"> | ||
<Pagination | ||
pagerBsSize={pagerBsSize} | ||
items={maxPage} | ||
next={this.getNext()} | ||
prev={this.getPrev()} | ||
maxButtons={Math.min(this.props.maxButtons, maxPage)} | ||
activePage={this.props.currentPage + 1} | ||
onSelect={this.handleSelect} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
GriddleCustomPager.propTypes = { | ||
currentPage : React.PropTypes.number, | ||
maxPage : React.PropTypes.number, | ||
maxButtons : React.PropTypes.number, | ||
nextText : React.PropTypes.string, | ||
previousText : React.PropTypes.string, | ||
pagerBsSize : React.PropTypes.string, | ||
setPage : React.PropTypes.func | ||
}; | ||
|
||
GriddleCustomPager.defaultProps = { | ||
currentPage : 0, | ||
maxPage : 0, | ||
maxButtons : 10, | ||
nextText : "Next", | ||
previousText : "Previous", | ||
pagerBsSize : "large" | ||
}; | ||
|
||
export default GriddleCustomPager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.