-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
82 lines (75 loc) · 2.24 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
<!DOCTYPE html>
<html>
<head>
<title>BatchBox</title>
<link rel="stylesheet" href="batchbox.css">
<script src="deps/jquery-1.6.1.min.js"></script>
<script src="deps/jquery-ui-1.8.13.custom.min.js"></script>
<script src="deps/jquery.placeholder.js"></script>
<script src="jquery.batchbox.js"></script>
<script>
$(document).ready(function() {
var settings = {
name: "batchboxNotify",
fields: [{name: 'name'}, {name: 'email'}],
deleteLabel: 'x',
sortable: true,
headings: false,
};
var data = [
{name: 'Alan Alston', email: '[email protected]'},
{name: 'Le Roux Bodenstein', email: '[email protected]'}
];
$('#notify').batchbox(settings, data);
$('#batchboxNotify').bind('batchbox:add', function(event, $tr, $data) {
$("#batchboxNotify tfoot input:first").focus();
});
$('#batchboxNotify').bind('batchbox:delete', function(event, $tr) {
});
var settings = {
name: "batchboxProducts",
fields: [{name: 'name'},
{name: 'price', label: '$'},
{name: 'sku'},
{name: 'quantity', placeholder: '# in stock'}],
deleteLabel: 'x',
sortable: true,
headings: false,
};
var data = [
{name: "Puppy", price: "100.00", sku: "droolrs01", quantity: "10"},
{name: "Kitten", price: "10.00", sku: "frblls02", quantity: "10"}
];
$('#products').batchbox(settings, data);
$('#batchboxProducts').bind('batchbox:add', function(event, $tr, $data) {
$("#batchboxProducts tfoot input:first").focus();
});
$('#batchboxProducts').bind('batchbox:delete', function(event, $tr) {
});
$('#batchboxform').submit(function() {
alert($('#batchboxNotify').batchbox('serialize'));
alert($('#batchboxProducts').batchbox('serialize'));
return false;
});
});
</script>
</head>
<body>
<form id="batchboxform" method="post">
<h1>BatchBox</h1>
<div class="fields">
<div id="notify">
<h2>Notify these people</h2>
<!-- the batchbox will go here. -->
</div>
<div id="products">
<h2>Here are my products</h2>
<!-- the batchbox will go here. -->
</div>
</div>
<div class="buttons">
<input type="submit" name="save" value="Save">
</div>
</form>
</body>
</html>