Last active
April 9, 2018 16:32
-
-
Save egorvinogradov/1123b2ece9089bfde03ef2ce39cb464c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| async componentDidMount(){ | |
| this.setState({isLoading: true}); | |
| const users = (await api.getAdminDashboardUsers()).data; | |
| const rows = this.convertUsersToGridRows(users); | |
| // Variable is out of component scope | |
| allPlatformCompanies = (await api.getAllPlatformCompanies()).data; | |
| await this.setState({ | |
| users, | |
| rows, | |
| isLoading: false, | |
| }); | |
| setTimeout(() => { | |
| this.refs['gridElement'].onToggleFilter(); // manually enabling filters toolbar in ReactDataGrid | |
| }, 500); | |
| // setTimeout(() => { | |
| // this.scrollableGrid = document.querySelector('.react-grid-Canvas'); | |
| // this.scrollableGrid.addEventListener('wheel', this.preventMacBackSwipe); | |
| // }, 1000); | |
| } | |
| // preventMacBackSwipe(e){ | |
| // if (e.deltaX && !e.deltaY) { | |
| // const grid = this.scrollableGrid; | |
| // const maxX = grid.scrollWidth - grid.offsetWidth; | |
| // const scrollLeft = grid.scrollLeft; | |
| // | |
| // if (scrollLeft <= 0) { | |
| // e.preventDefault(); | |
| // grid.scrollLeft = 0; | |
| // } | |
| // | |
| // if (scrollLeft >= maxX) { | |
| // e.preventDefault(); | |
| // grid.scrollLeft = maxX; | |
| // } | |
| // } | |
| // } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment