Skip to content

Commit

Permalink
#133. Fix setState with callback in doSearch + build 2.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurkushman committed Jun 5, 2019
1 parent 28a9278 commit 6d26ffc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

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": "2.9.6",
"version": "2.9.7",
"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
10 changes: 6 additions & 4 deletions src/components/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ class Main extends Component {

this.tOut = [];
this.c = 0;
this.createTable(nJson, this.state.sortedButtons, this.state.selectedRows);
this.setState({page: 1});
this.setState({page: 1}, () => {
this.createTable(nJson, this.state.sortedButtons, this.state.selectedRows);
});
} else {
this.tOut[this.c] = setTimeout(function () {
that.createTable(nJson, that.state.sortedButtons, that.state.selectedRows);
that.setState({page: 1});
that.setState({page: 1}, () => {
that.createTable(nJson, that.state.sortedButtons, that.state.selectedRows);
});
}, CommonConstants.TIMEOUT_SEARCH);
this.c++;
}
Expand Down

0 comments on commit 6d26ffc

Please sign in to comment.