-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patholdJS.js
39 lines (27 loc) · 1.07 KB
/
oldJS.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//PAGING - FORWARD
getNextPages() {
let position = this.props.page.length //the set that you're viewing (length of the page)
let qty = this.state.numberOf //set how many you're viewing
let where = this.state.pg + position //updating set + position to change to next set
this.setState({
pg: where
})
console.log("Which set; position: " + where)
console.log("How many to view: " + qty)
this.props.next(qty, where)
}
//PAGING - BACK
getPrevPages() {
let position = this.props.page.length //the set that you're viewing (length of the page)
let qty = this.state.numberOf //set how many you're viewing
if (this.state.pg <= 1) {
this.props.next(qty, 0)
}
else {
let where = this.state.pg - position //updating set + position to change to next set
this.setState({
pg: where
})
this.props.next(qty, where)
}
}