Skip to content

Commit

Permalink
* #34. prev/next via hot keys + readme
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurkushman committed Mar 29, 2017
1 parent 4a66c31 commit be1ae33
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ To efficiently manage table behavior You can use the following hot keys:
- Ctrl+A - selects all rows in a current table view
- Ctrl+Arrow Right - next page
- Ctrl+Arrow Left - prev page
PS In some OS like Macintosh can be default conflicting hot keys, ex.: Cmd+Arrow Left get back in browsers
## FAQ
**Can I use file types in GT editor to upload files through AJAX on server?**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gigatables-react",
"version": "1.1.9",
"version": "1.2.0",
"description": "GigaTables is a ReactJS plug-in to help web-developers process table-data in applications and CMS, CRM, ERP or similar systems. It supports ajax data processing/editing (CRUD), pagination, cross-sorting, global search, shft/ctrl rows selection, 7 popular languages and more.",
"main": "./build/index.js",
"dependencies": {
Expand Down
12 changes: 8 additions & 4 deletions src/components/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,25 +693,29 @@ class Main extends React.Component {
let pages = Math.ceil(countRows / perPage);
this.setState({
fromRow: (pages - 1) * perPage,
page: pages
page: pages,
arrowLeft: false
}, () => {this.createTable(this.jsonData, this.state.sortedButtons)});
} else {
this.setState({
fromRow: (page - 1) * perPage,
page: page - 1
page: page - 1,
arrowLeft: false
}, () => {this.createTable(this.jsonData, this.state.sortedButtons)});
}
} else if (ctrlDown === true && arrowRight === true) {
let pages = Math.ceil(countRows / perPage);
if (page === pages) {
this.setState({
fromRow: 0,
page: 1
page: 1,
arrowRight: false
}, () => {this.createTable(this.jsonData, this.state.sortedButtons)});
} else {
this.setState({
fromRow: page * perPage,
page: page + 1
page: page + 1,
arrowRight: false
}, () => {this.createTable(this.jsonData, this.state.sortedButtons)});
}
}
Expand Down

0 comments on commit be1ae33

Please sign in to comment.