28
28
$(document).ready(function() {
29
29
30
30
$("#grid-<?php echo $ grid ->get_identifier ()?> ").sparkGrid({
31
- identifier : '<?php echo $ grid ->get_identifier (); ?> ',
32
- url : '<?php echo $ grid ->get_url (); ?> ',
33
- vars : {
34
- limit : '<?php echo $ grid ->get_var_name_limit (); ?> ',
35
- page : '<?php echo $ grid ->get_var_name_page (); ?> ',
36
- sort : '<?php echo $ grid ->get_var_name_sort (); ?> ',
37
- direction : '<?php echo $ grid ->get_var_name_direction (); ?> ',
38
- filters : '<?php echo $ grid ->get_var_name_filters (); ?> '
31
+ identifier : '<?php echo $ grid ->get_identifier (); ?> ',
32
+ url : '<?php echo $ grid ->get_url (); ?> ',
33
+ vars : {
34
+ limit : '<?php echo $ grid ->get_var_name_limit (); ?> ',
35
+ page : '<?php echo $ grid ->get_var_name_page (); ?> ',
36
+ sort : '<?php echo $ grid ->get_var_name_sort (); ?> ',
37
+ direction : '<?php echo $ grid ->get_var_name_direction (); ?> ',
38
+ filters : '<?php echo $ grid ->get_var_name_filters (); ?> '
39
39
},
40
- ajax : <?php echo (int ) $ grid ->get_uses_ajax (); ?>
40
+ ajax : <?php echo (int ) $ grid ->get_uses_ajax (); ?> ,
41
+ showOverlay : true,
42
+ <?php
43
+ /**
44
+ * See http://api.jquery.com/fadeIn/
45
+ * for fadeIn speed options, eg:
46
+ * - 'fast'
47
+ * - 'slow'
48
+ * - 200
49
+ * - 100
50
+ */
51
+ ?>
52
+ fadeOverlaySpeed : 100
41
53
<?php if (($ params = $ grid ->get_current_params_json ()) !== false ): ?>
42
54
, currentParams: <?php echo $ params ; ?>
43
55
<?php endif ?>
44
56
});
45
57
});
46
58
47
59
</script>
60
+
61
+ <?php
62
+ /**
63
+ * The grid controls - pagination
64
+ */
65
+ ?>
48
66
<table class="controls">
49
67
<tbody>
50
68
<tr>
66
84
</tr>
67
85
</tbody>
68
86
</table>
87
+
88
+ <?php
89
+ /**
90
+ * The grid itself
91
+ */
92
+ ?>
69
93
<table class="grid">
94
+
95
+ <?php
96
+ /**
97
+ * The head of the table
98
+ */
99
+ ?>
70
100
<thead>
101
+
102
+ <?php
103
+ /**
104
+ * The headers for the grid
105
+ */
106
+ ?>
71
107
<tr class="headers">
72
108
<?php foreach ($ grid ->get_columns () as $ column ): ?>
73
109
<th class="<?php echo $ column ->get_class (); ?> " style="<?php echo $ column ->get_style (); ?> ">
74
110
<?php echo $ column ->get_header (); ?>
75
111
</th>
76
112
<?php endforeach ?>
77
113
</tr>
114
+
115
+ <?php
116
+ /**
117
+ * The filters for the grid
118
+ */
119
+ ?>
78
120
<tr class="filters">
79
121
<?php foreach ($ grid ->get_columns () as $ column ): ?>
80
122
<th class="<?php echo $ column ->get_class (); ?> " style="<?php echo $ column ->get_style (); ?> ">
83
125
<?php endforeach ?>
84
126
</tr>
85
127
</thead>
128
+
129
+ <?php
130
+ /**
131
+ * The body of the table
132
+ */
133
+ ?>
86
134
<tbody>
87
135
<?php foreach ($ grid ->get_rows () as $ row ): ?>
88
136
<tr class="<?php echo $ row ->get_class (); ?> ">
95
143
<?php endforeach ?>
96
144
</tbody>
97
145
</table>
146
+
147
+ <?php
148
+ /**
149
+ * The overlay div that's shown when the grid is loading
150
+ */
151
+ ?>
152
+ <div class="overlay">
153
+ <div class="loading">
154
+ <h1>Loading</h1>
155
+ </div>
156
+ </div>
98
157
</div>
0 commit comments