-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
107 lines (96 loc) · 2.92 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
<html ng-app="demo">
<head>
<title>DragTable in AngularJS</title>
<style>
body {
padding:20px 20px 0;
}
p, li {
max-width: 480px;
line-height: 1.5em;
}
code {
background: #eee;
padding: 1px 3px;
}
table {
width: 480px;
border-collapse: collapse;
border: 1px solid #69c;
text-align: left;
margin: 20px;
}
th {
border-bottom: 1px dashed #69c;
padding: 12px 17px;
}
td {
padding: 7px 17px;
}
</style>
</head>
<body>
<h1>Examples of DragTable in AngularJS:</h1>
<p>DragTable is an <a href="http://angularjs.org/">AngularJS</a> directive is based upon <a href="http://www.danvk.org/wp/dragtable/">danvk's dragtable</a>. It does <b>not</b> require jQuery.
<h3>Demos:</h3>
<p>Simple table</p>
<table draggable>
<thead>
<tr>
<th id="x">Name</th>
<th>Favorite Color</th><th>Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dan</td>
<td>Blue</td><td>1984-07-12</td>
</tr>
<tr>
<td>Alice</td>
<td>Green</td><td>1980-07-22</td>
</tr>
</tbody>
</table>
<p><b>With callback:</b></p>
<div ng-controller="CallbackCtrl">
<p>Callback Message: {{ message }}</p>
<table draggable on-drag-end="drag_callback($start, $target)">
<thead>
<tr>
<th id="x">Name</th>
<th>Favorite Color</th><th>Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dan</td>
<td>Blue</td><td>1984-07-12</td>
</tr>
<tr>
<td>Alice</td>
<td>Green</td><td>1980-07-22</td>
</tr>
</tbody>
</table>
</div>
<h3>Usage:</h3>
<ol>
<li>
Include the <code>dragtable</code> module in your Angular app: <code>var app = angular.module('demo', ['dragtable']);</code>
</li>
<li>
Add the <code>draggable</code> attribute to any table. Eg:
<pre>
<table draggable>
...
</table>
</pre>
</li>
</ol>
<p>Original code by <a href="http://www.danvk.org/wp/dragtable/">Dan</a> and ported by <a href="http://fully-faltoo.com">Pratyush Mittal</a> to AngularJS.</p>
<small>License: DragTable for AngularJS is under <a href="http://www.wtfpl.net/">WTFPL license</small>.
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
<script src="dragtable.js"></script>
<script src="app.js"></script>
</body>