-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
125 lines (115 loc) · 3.63 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html>
<head>
<title>ls-grid demo</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<!-- VENDORS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.4/lodash.min.js"></script>
<script src="scripts/vendor/angular-paging.js"></script>
<script src="scripts/vendor/angular-pagination.js"></script>
<!-- LS-GRID COMPONENTS -->
<script src="components/lsPager/lsPager.js"></script>
<script src="components/lsGrid/lsGrid.js"></script>
<link rel="stylesheet" href="components/lsGrid/lsGrid.css"/>
<!--APPLICATION-->
<script src="lsGridDemo.js"></script>
</head>
<body ng-app="app" ng-controller="demo">
<h2 style="margin: 20px;">ls-grid: Simple AngularJS grid examples</h2>
<hr/>
<h4 style="margin: 20px;">See readme and source at <a href="https://github.com/lev-savranskiy/angular-ls-grid"
target="_blank">github</a></h4>
<h4 style="margin: 20px;">See whole <a href="/folio">Portfolio</a></h4>
<hr/>
<div style="margin: 20px;">
<h4>Local data, tableWidth, itemsPerPage, sort by start_date DESC, and 3 headers passed </h4>
<pre style="height: 200px; width: 40%; overflow: auto">
var app = angular.module('app', ['lsGrid']);
app.controller("demo", function ($scope) {
var data = [{
"id": 577,
"name": "Realcube",
"start_date": "2016-12-30",
"clicks": 31
}, {
"id": 561,
"name": "JumpXS",
"start_date": "2017-02-15",
"clicks": 85
},
var data = [{
"id": 577,
"name": "Realcube",
"start_date": "2016-12-30",
"clicks": 31
}, {
"id": 561,
"name": "JumpXS",
"start_date": "2017-02-15",
"clicks": 85
} ... ]
$scope.options = {
tableWidth: '600px',
itemsPerPage: 7,
sorter: {
field: 'start_date',
dir: 'desc'
},
headers: {"name": "Name", "start_date": "Start Date", "clicks": "Clicks"},
data: data
};
});
<ls-grid options="options"></ls-grid>
</pre>
<h4>Result</h4>
<ls-grid options="options"></ls-grid>
</div>
<hr/>
<div style="margin: 20px;">
<h4>Remote data with unknown structure, headers created based on data. </h4>
<pre style="height: 200px; width: 40%; overflow: auto">
var app = angular.module('app', ['lsGrid']);
app.controller("demo", function ($scope) {
$scope.options2 = {
tableWidth: '40%',
itemsPerPage: 10,
dataUrl: 'api/data.json'
};
});
<ls-grid options="options2"></ls-grid>
</pre>
<h4>Result</h4>
<ls-grid options="options2"></ls-grid>
</div>
<hr/>
<div style="margin: 20px;">
<h4>No configuration at all</h4>
<pre style="height: 130px; width: 40%; overflow: auto">
var app = angular.module('app', ['lsGrid']);
app.controller("demo", function ($scope) {
});
<ls-grid></ls-grid>
</pre>
<h4>Result</h4>
<ls-grid></ls-grid>
</div>
<hr/>
<div style="margin: 20px;">
<h4>Bad configuration: wrong remote URL</h4>
<pre style="height: 200px; width: 40%; overflow: auto">
var app = angular.module('app', ['lsGrid']);
app.controller("demo", function ($scope) {
$scope.options3 = {
dataUrl: 'api/404.json'
};
});
<ls-grid options="options3"></ls-grid>
</pre>
<h4>Result</h4>
<ls-grid options="options3"></ls-grid>
</div>
</body>
</html>