-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy pathdemo.html
More file actions
146 lines (121 loc) · 3.24 KB
/
demo.html
File metadata and controls
146 lines (121 loc) · 3.24 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Resize Demo Page</title>
<style type='text/css'>
body {font-family: verdana}
.error {border: solid 1px red;}
.error_text { color: red; font-size: 10px;}
td {padding: 3px;}
.resizable {border: solid 1px red;
}
body {
margin: 0px;
padding: 0px;
}
h1 {
border: solid 2px green;
}
#content {
border: solid 2px red;
}
#out {
padding: 10px;
}
#split {
border: solid 2px BLUE;
}
h3 {
background-color: yellow;
padding: 10px;
margin: 0px;
}
.top {
border: dotted 1px orange;
}
</style>
<link type="text/css" href="../../../mxui/data/grid/grid.css" rel="stylesheet" />
</head>
<body>
<div id='out'>
<h1>My Application's Title (it's long so it will wrap)</h1>
<div id='content'>
<span>Some Buttons For Folders and Files</span>
<div id='split'>
<div class='panel' style="width:100px;position:absolute;">
<h3>Folders:</h3>
<ul>
<li>Folder One</li>
<li>Folder Two</li>
<li>Folder Three</li>
<li>Folder Four</li>
<li>Folder Five</li>
<li>Folder Six</li>
<li>Folder Seven</li>
</ul>
</div>
<div class='panel' style="width:300px;position:absolute;" id='leftPanel'>
<div id='vsplit'>
<div class='top' style='height: 300px'>
<div id='forever'></div>
</div>
<div class='bottom' style='height: 100px'>
Here are some file details
</div>
</div>
</div>
</div>
<span>A footer</span>
</div>
</div>
<script type='text/javascript'
src='../../../steal/steal.js'>
</script>
<script type='text/ejs' id='rowEjs'>
<td><%= name %></td>
<td><%= birthday %></td>
<td><%= foo %></td>
</script>
<script type='text/javascript'>
steal('mxui/data/grid','mxui/layout/split',
'jquery/dom/fixture').then(function(){
$('#content').mxui_layout_fill(document.body)
$('#split').mxui_layout_fill('#content')
.mxui_layout_split({ direction: "vertical", panelClass: "panel" })
$('#vsplit').mxui_layout_fill($('#leftPanel'))
.mxui_layout_split({ direction: "horizontal" });
$.Model('Thing',{
attributes : {birthday: "date"}
},{})
$.fixture.make('thing', 1000, function(i){
return {
id: i,
name : "thing "+i,
birthday : Math.round(new Date()*Math.random()),
foo : "bar"
}
})
// we need to also provide the grid with data ...
var paramsScroll = new Mxui.Data({limit : 50, offset: 0})
// Forever Scroll
$("#forever").mxui_data_grid({
model : Thing,
params : paramsScroll,
columns: {
name: "Name",
birthday: "Birthday",
foo : "Thisisaverylongtitle"
},
row : "rowEjs",
offsetEmpties: false
})
$("#forever .scrollBody").bind("scroll", function(){
if(this.clientHeight+this.scrollTop + 70 >= this.scrollHeight && !paramsScroll.updating){
paramsScroll.attr('offset', paramsScroll.offset + 30)
}
})
});
</script>
</body>
</html>