-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.jsx
80 lines (74 loc) · 2.15 KB
/
example.jsx
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import React, {Component} from 'react';
import {Table, Column, Cell} from 'fixed-data-table-2';
import ExampleCell from './ExampleCell.jsx';
import {StyleSheet, css} from 'aphrodite';
class ExampleTable extends Component {
constructor(props){
super(props);
this.state = {
tableWidth: 500
}
this._updateDimensions = this._updateDimensions.bind(this);
}
componentWillMount() {
this._updateDimensions();
}
componentDidMount() {
window.addEventListener("resize", this._updateDimensions);
}
componentWillUnmount() {
window.removeEventListener("resize", this._updateDimensions);
}
_updateDimensions(){
let wifth = ($(window).width()/1.2);
let minWifth = ($(window).width());
if(minWifth >= 1050){
this.setState({tableWidth: wifth});
}else{
this.setState({tableWidth: wifth+282});
}
}
render() {
return (
<div>
<Table
className={css(styles.wrapperStyles)}
rowHeight={35}
headerHeight={30}
rowsCount={this.props.data.length}
width={this.state.tableWidth}
height={975}
>
<Column
header={<Cell className={css(styles.newTableHeader)}>Access Groups</Cell>}
cell={<ExampleCell
data={this.props.data}
field="groupName"
className="userNameCell"
/>}
width={460}
flexGrow={1}
/>
</Table>
</div>
);
}
}
export default ExampleTable;
const styles = StyleSheet.create({
wrapperStyles: {
marginTop: '1rem',
marginLeft: '1rem',
marginRight: "3rem",
boxShadow: 'none',
border: "none",
overflow:"hidden",
height: "100%"
},
newTableHeader:{
color: "#005FCC",
fontSize: "18px",
lineHeight: '1',
background: "#FFFFFF"
}
})