Skip to content

Commit d177ac1

Browse files
committed
Merge branch 'master' into snyk-fix-57c948c723a91e9b62d6da7d2facad2d
2 parents c488c33 + fc37619 commit d177ac1

15 files changed

+46906
-242
lines changed

example/dist/0.9089abcc883df2250569.hot-update.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/dist/9089abcc883df2250569.hot-update.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/dist/index.js

Lines changed: 46626 additions & 3 deletions
Large diffs are not rendered by default.

example/src/UserList.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
import React, { Component, Fragment } from 'react';
2-
import ReactDatatable from '../../lib/index.js';
3-
// import ReactDatatable from '../../src/index.js';
2+
// import ReactDatatable from '../../lib/index.js';
3+
import ReactDatatable from '../../src/index.js';
4+
import users from '../data/data.json';
45

56
class UserList extends Component {
67
constructor(props) {
78
super(props);
9+
this.state = {
10+
loading: true,
11+
users: []
12+
};
13+
814
this.deleteUser = this.deleteUser.bind(this);
915
this.columns = [
1016
{
@@ -93,7 +99,7 @@ class UserList extends Component {
9399
last: "Last"
94100
}
95101
},
96-
pagination: "advance",
102+
pagination: "basic", //advance
97103
show_length_menu: true,
98104
show_filter: true,
99105
show_pagination: true,
@@ -131,6 +137,15 @@ class UserList extends Component {
131137
]
132138
}
133139

140+
componentDidMount () {
141+
setTimeout(() => {
142+
this.setState({
143+
loading: false,
144+
users: users
145+
})
146+
}, 5000);
147+
}
148+
134149
editUser(user) {
135150
console.log("Edit User", user);
136151
}
@@ -148,10 +163,11 @@ class UserList extends Component {
148163
<div>
149164
<ReactDatatable
150165
config={this.config}
151-
records={this.props.users}
166+
records={this.state.users}
152167
columns={this.columns}
153168
onPageChange={this.pageChange.bind(this)}
154169
extraButtons={this.extraButtons}
170+
loading={this.state.loading}
155171
/>
156172
</div>
157173
)

example/src/Users.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
import React, { Component } from 'react';
22
import UserList from './UserList.js';
3-
import users from '../data/data.json'
43

54
class Users extends Component {
65
constructor(props) {
76
super(props);
87
this.state = {
9-
users: users
8+
users: []
109
};
1110
}
12-
13-
componentDidMount() {
14-
}
1511

1612
render() {
1713
return (
1814
<div className="container">
19-
{/* <h2>Restaurants:</h2> */}
20-
<UserList users={this.state.users}/>
15+
<UserList />
2116
</div>
2217
)
2318
}

src/style.css renamed to src/assets/css/style.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,10 @@ th.sortable {
2121
}
2222
.asrt-pagination {
2323
margin: 0;
24+
}
25+
.asrt-td-loading {
26+
background-color: #fff;
27+
}
28+
.asrt-loading-textwrap{
29+
padding: 5px 0px;
2430
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)