-
Notifications
You must be signed in to change notification settings - Fork 0
/
BackboneTable.html
87 lines (74 loc) · 1.97 KB
/
BackboneTable.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
<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 500px;
}
table, th, td {
border: 1px solid black;
}
.selected {
background-color: blue;
}
</style>
<!-- dependencies -->
<script src="http://code.jquery.com/jquery-2.1.4.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.2.1/backbone.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/backbone.marionette/2.4.2/backbone.marionette.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.js'></script>
<!-- templates -->
<script type="text/template" id='table-tmpl'>
<thead id='columns' />
<tbody id='rows' />
</script>
<!-- app classes -->
<script src='SetDelegate.js'></script>
<script src='CellModel.js'></script>
<script src='CellCollection.js'></script>
<script src='RowModel.js'></script>
<script src='RowCollection.js'></script>
<script src='ColumnModel.js'></script>
<script src='ColumnCollection.js'></script>
<script src='TableModel.js'></script>
<script src='MockData.js'></script>
<script src='ColumnView.js'></script>
<script src='RowView.js'></script>
<script src='TableView.js'></script>
</head>
<body>
<script>
/*
var Bar = Foo.extend({
get: function() {
alert("Baz");
}
});
console.log(Bar.extend);
var Cux = Bar.extend({
asdf: function() {
alert("ASDF");
}
});
var test = new Cux();
test.asdf();
*/
// var test = new Bar();
/*
test.set();
test.get();
*/
//console.log(Bar.extend);
var $doc = $(document);
$doc.click(function(e) {
console.log("Click");
console.log(e);
});
$doc.trigger("click");
var table = new TableModel(tableData);
var view = new TableView({model: table});
$("body").append( view.render().el );
</script>
</body>
</html>