-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
44 lines (40 loc) · 1.69 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Griddle with Callback test</title>
</head>
<body>
<div id="griddle-callback"></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react-dom.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/react/0.12.1/JSXTransformer.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
<script src="build/GriddleWithCallback.js"></script>
<script type="text/javascript" src="swapi.min.js"></script>
<script type="text/jsx">
var setDefault = function(original, value){
return typeof original === 'undefined' ? value : original;
}
var loadData = function(filterString, sortColumn, sortAscending, page, pageSize, callback) {
page+=1;
swapiModule.getStarships(page, function(data){
callback({
results: data.results,
totalResults: data.count,
pageSize: pageSize
});
});
};
var Loading = React.createClass({
getDefaultProps: function(){
return {
loadingText: "Loading"
}
},
render: function(){
return <div className="loading">{this.props.loadingText}</div>;
}
});
ReactDOM.render(<GriddleWithCallback getExternalResults={loadData} loadingComponent={Loading} enableSort={true} enableInfiniteScroll={true} bodyHeight={200} columns={["name", "model", "manufacturer", "passengers"]} resultsPerPage={10} showFilter={false} showSettings={false} />, document.getElementById('griddle-callback'));
</script>
</body>