forked from jeremieroy/react_smart_table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
58 lines (52 loc) · 1.69 KB
/
example.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>React smart table example</title>
<!-- css -->
<link rel="stylesheet" href="react_smart_table.css" >
<!-- js -->
<script src="https://fb.me/react-0.13.1.js"></script>
<script src="react_smart_table.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
-->
<!-- Latest compiled and minified JavaScript
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
-->
</head>
<body>
<!-- page content -->
<div id="smart_table1">Lorem ipsum</div>
<script>
function randomString(length)
{
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ";
for( var i=0; i < length; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
var rowCount = 200;
var columnCount = 10;
var data=[];
for(var row=0; row<200;row++)
{
var item = {};
item["id"] = row;
for(var col=0; col<10;col++)
{
item["column"+col.toString()] = randomString(3);
}
data.push(item);
}
var Table = React.createFactory(ReactSmartTable.Table);
React.render(
Table({ data:data}),
document.getElementById('smart_table1')
);
</script>
</body>
</html>