This repository was archived by the owner on Jan 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Expand file tree
/
Copy pathtest.html
More file actions
47 lines (41 loc) · 1.62 KB
/
test.html
File metadata and controls
47 lines (41 loc) · 1.62 KB
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
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.3.js"></script>
<script src="build/reactable.js" type="text/javascript"></script>
<script type="text/jsx">
/** @jsx React.DOM */
var Table = Reactable.Table,
Thead = Reactable.Thead,
Th = Reactable.Th,
Tr = Reactable.Tr,
Td = Reactable.Td,
unsafe = Reactable.unsafe;
class Cell extends React.Component {
handleClick(){
alert(this.props.text);
}
render() {
if (this.props.text) {
return <button onClick={this.handleClick.bind(this)}>{this.props.text}</button>;
} else {
return null;
}
}
}
ReactDOM.render(
<Table className="table" columnFormatters={ { 'Name' : Cell, 'Position': Cell } } id="table" data={[
{ Name: 'Griffin Smith', Age: '18'},
{ Age: '28', Name:'Aaron Lisman', Position:'Developer'},
{ Age: '23', Name: <i>Lee Salminen</i> },
]} sortable={['Name']} />,
document.getElementById('test-div')
);
</script>
</head>
<body>
<div id="test-div"></div>
</body>
</html>