forked from ManifestWebDesign/angular-gridster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
116 lines (103 loc) · 4.05 KB
/
test.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
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Angular Gridster</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="dist/angular-gridster.min.css" />
<link rel="stylesheet" href="demo/common/style.css" />
<link rel="stylesheet" href="demo/main/style.css" />
<!--
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="https://rawgit.com/sdecima/javascript-detect-element-resize/master/detect-element-resize.js"></script>
-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.js"></script>
<script src="src/angular-gridster.js"></script>
<script type="text/javascript">
(function() {
angular.module('app', ['gridster']);
})();
</script>
<script src="demo/main/script.js"></script>
</head>
<body ng-app="app">
<div >
<div class="container" ng-view>
<div class="demo-container" ng-controller="MainCtrl">
<h2>Standard Items</h2>
<p>
Each item provides its own dimensions and position using the standard fields: { row: row, col: col, sizeX: sizeX, sizeY: sizeY }.
</p>
<div gridster="gridsterOpts">
<ul>
<li gridster-item="item" ng-repeat="item in standardItems">
<div class="remove-item" ng-click="removeItem($index)"> x </div>
<input type="text" integer ng-model="item.row" size="1" />,
<input type="text" integer ng-model="item.col" size="1" />
<br />
<input type="text" integer ng-model="item.sizeX" size="1" />x
<input type="text" integer ng-model="item.sizeY" size="1" />
</li>
</ul>
</div>
<h2>Custom Items</h2>
<p>
Each item provides its own dimensions but with custom fields defined using customItemMap: { position: [row, col], size: { x: sizeX, y: sizeY }}
</p>
<div gridster="gridsterOpts">
<ul>
<li gridster-item="customItemMap" ng-repeat="item in customItems">
<input type="text" integer ng-model="item.position[0]" size="1" />,
<input type="text" integer ng-model="item.position[1]" size="1" />
<br />
<input type="text" integer ng-model="item.size.x" size="1" />x
<input type="text" integer ng-model="item.size.y" size="1" />
</li>
</ul>
</div>
<h2>Custom Items2</h2>
<p>
Each item provides its own dimensions but with custom fields indicated using html attributes: row, col, sizex, sizey. Size can also be in the form of data-size-x or data-sizex.
</p>
<div gridster="gridsterOpts">
<ul>
<li gridster-item row="item.position[0]" col="item.position[1]" size-x="item.size.x" size-y="item.size.y" ng-repeat="item in customItems">
<input type="text" integer ng-model="item.position[0]" size="1" />,
<input type="text" integer ng-model="item.position[1]" size="1" />
<br />
<input type="text" integer ng-model="item.size.x" size="1" />x
<input type="text" integer ng-model="item.size.y" size="1" />
</li>
</ul>
</div>
<h2>Empty Items</h2>
<p>
Each item stores the standard options as an object within itself: { grid: {row: row, col: col, sizeX: sizeX, sizeY: sizeY }}
</p>
<div gridster="gridsterOpts">
<ul>
<li gridster-item="item.grid" ng-repeat="item in emptyItems">
<input type="text" integer ng-model="item.grid.row" size="1" />,
<input type="text" integer ng-model="item.grid.col" size="1" />
<br />
<input type="text" integer ng-model="item.grid.sizeX" size="1" />x
<input type="text" integer ng-model="item.grid.sizeY" size="1" />
</li>
</ul>
</div>
<h2>No Configuration or Binding</h2>
<p>
No data binding or configuration provided.
</p>
<div gridster>
<ul>
<li gridster-item></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>