forked from Comcast/react-data-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample01-basic.js
More file actions
61 lines (50 loc) · 996 Bytes
/
Copy pathexample01-basic.js
File metadata and controls
61 lines (50 loc) · 996 Bytes
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
var QuickStartDescription = require('../components/QuickStartDescription')
var ReactPlayground = require('../assets/js/ReactPlayground');
var SimpleExample = `
var _rows = [];
for (var i = 1; i < 1000; i++) {
_rows.push({
id: i,
title: 'Title ' + i,
count: i * 1000
});
}
//A rowGetter function is required by the grid to retrieve a row for a given index
var rowGetter = function(i){
return _rows[i];
};
var columns = [
{
key: 'id',
name: 'ID'
},
{
key: 'title',
name: 'Title'
},
{
key: 'count',
name: 'Count'
}
]
var Example = React.createClass({
render: function() {
return (<ReactDataGrid
columns={columns}
rowGetter={rowGetter}
rowsCount={_rows.length}
minHeight={500} />);
}
});
ReactDOM.render(<Example />, mountNode);
`;
module.exports = React.createClass({
render:function(){
return(
<div>
<h3>A Simple Example</h3>
<ReactPlayground codeText={SimpleExample} />
</div>
)
}
});