forked from paulopmx/Flexigrid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
381 lines (368 loc) · 10.4 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Flexigrid</title>
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" type="text/css" href="../css/flexigrid.pack.css" />
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="../js/flexigrid.pack.js"></script>
</head>
<body>
<img src="images/flash.png" alt="Flexigrid" width="960" height="483"
usemap="#Map" style="visibility: hidden"
onload="$(this).css({visibility:'visible',display:'none'}).fadeIn('slow');"
title="Flexigrid" border="0" />
<map name="Map" id="Map">
<area shape="rect" coords="671,29,853,72" href="https://code.google.com/p/flexigrid/downloads/list?q=label:Featured"
alt="Download" />
</map>
<h1 class="title" style="display: none">
<strong>Flexigrid</strong> for jQuery<span
style="font-size: 12px">by Paulo P. Marinas</span>
</h1>
<div class="update">
<h2>What is it?</h2>
<p>Lightweight but rich data grid with resizable columns and a
scrolling data to match the headers, plus an ability to connect to an
xml based data source using Ajax to load the content.</p>
<p>Similar in concept with the Ext Grid only its pure jQuery love,
which makes it light weight and follows the jQuery mantra of running
with the least amount of configuration.</p>
<h3>Features</h3>
<ul>
<li>Resizable columns</li>
<li>Resizable height and width</li>
<li>Sortable column headers</li>
<li>Cool theme</li>
<li>Can convert an ordinary table</li>
<li>Ability to connect to an ajax data source (XML and JSON[new])</li>
<li>Paging</li>
<li>Show/hide columns</li>
<li>Toolbar (new)</li>
<li>Search (new)</li>
<li>Accessible API</li>
<li>Many more</li>
</ul>
</div>
<div class="update">
<h2>FAQ</h2>
<ol>
<li><div class="question">Where can I get support?</div>
<div class="answer">
Bugs can be reported
<a href="http://code.google.com/p/flexigrid/">http://code.google.com/p/flexigrid/</a>, and
our fantastic community support is available at
<a href="http://groups.google.com/group/flexigrid/">http://groups.google.com/group/flexigrid/</a>.
</div>
</li>
<li>
<div class="question">What's recently changed and what are the known bugs?</div>
<div class="answer">Go to
<a href="http://code.google.com/p/flexigrid/issues/list">
http://code.google.com/p/flexigrid/issues/list</a>
</div>
</li>
<li><div class="question">What browsers does Flexigrid support?</div>
<div class="answer">We support browsers IE6, Firefox 3, Opera 9,
Safari 3, Chrome 7 and greater.</div>
</li>
<li><div class="question">Where can I contribute code or suggest a feature?</div>
<div class="answer"><a href="http://code.google.com/p/flexigrid/">http://code.google.com/p/flexigrid/</a></div>
</li>
<li><div class="question">Can I use it for personal or commercial projects/modify it/hack it?</div>
<div class="answer">Absolutely! Just make sure you adhere to either the <a href="http://jquery.org/license">GPL or MIT licenses</a>.</div>
</li>
<li><div class="question">Can I connect this to a form or add Parameters?</div>
<div class="answer">Sure, check out our <a href="sample.html">sample code</a>
to learn how.</div>
</li>
</ol>
</div>
<div class="update">
<h2>Files you need</h2>
<ul>
<li><a href="http://www.jquery.com">jQuery</a></li>
<li><a href="https://code.google.com/p/flexigrid/downloads/list?q=label:Featured">FlexiGrid Plugin Pack(32K)</a>
(includes the js, css, and images)</li>
</ul>
</div>
<div class="update">
<h2>How to use</h2>
<p>Check out the examples below, or
<a href="http://code.google.com/p/flexigrid/source/">browse the source</a>.</p>
</div>
<h2>Example 1</h2>
<p>
The most basic example with the zero configuration, with a table
converted into flexigrid (<a href="#"
onclick="$(this).parent().next().toggle(); return false;">Show
sample code</a>)
</p>
<div class="code">
<pre>$('.flexme').flexigrid();</pre>
</div>
<table class="flexme1">
<thead>
<tr>
<th width="100">Col 1</th>
<th width="100">Col 2</th>
<th width="100">Col 3 is a long header name</th>
<th width="300">Col 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>This is data 1 with overflowing content</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
</tbody>
</table>
<h2>Example 2</h2>
<p>
Table converted into flexigrid with height, and width set to auto,
stripes remove. (<a href="#"
onclick="$(this).parent().next().toggle(); return false;">Show
sample code</a>)
</p>
<div class="code">
<pre>$('.flexme2').flexigrid({height:'auto',striped:false});</pre>
</div>
<table class="flexme2">
<thead>
<tr>
<th width="100">Col 1</th>
<th width="100">Col 2</th>
<th width="100">Col 3 is a long header name</th>
<th width="300">Col 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>This is data 1 with overflowing content</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
<tr>
<td>This is data 1</td>
<td>This is data 2</td>
<td>This is data 3</td>
<td>This is data 4</td>
</tr>
</tbody>
</table>
<h2>Example 3</h2>
<p>
Flexigrid with a dynamic data, paging, search, toolbar, and connected
to an JSON file. (<a href="#"
onclick="$(this).parent().next().toggle(); return false;">Show
sample code</a>)
</p>
<div class="code">
<pre>
$("#flex1").flexigrid({
url: 'post2.php',
dataType: 'json',
colModel : [
{display: 'ISO', name : 'iso', width : 40, sortable : true, align: 'center'},
{display: 'Name', name : 'name', width : 180, sortable : true, align: 'left'},
{display: 'Printable Name', name : 'printable_name', width : 120, sortable : true, align: 'left'},
{display: 'ISO3', name : 'iso3', width : 130, sortable : true, align: 'left', hide: true},
{display: 'Number Code', name : 'numcode', width : 80, sortable : true, align: 'right'}
],
buttons : [
{name: 'Add', bclass: 'add', onpress : test},
{name: 'Delete', bclass: 'delete', onpress : test},
{separator: true}
],
searchitems : [
{display: 'ISO', name : 'iso'},
{display: 'Name', name : 'name', isdefault: true}
],
sortname: "iso",
sortorder: "asc",
usepager: true,
title: 'Countries',
useRp: true,
rp: 15,
showTableToggleBtn: true,
width: 700,
height: 200
});
</pre>
</div>
<table class="flexme3" style="display: none"></table>
<script type="text/javascript">
$('.flexme1').flexigrid();
$('.flexme2').flexigrid({
height : 'auto',
striped : false
});
$(".flexme3").flexigrid({
url : 'post-xml.php',
dataType : 'xml',
colModel : [ {
display : 'ISO',
name : 'iso',
width : 40,
sortable : true,
align : 'center'
}, {
display : 'Name',
name : 'name',
width : 180,
sortable : true,
align : 'left'
}, {
display : 'Printable Name',
name : 'printable_name',
width : 120,
sortable : true,
align : 'left'
}, {
display : 'ISO3',
name : 'iso3',
width : 130,
sortable : true,
align : 'left',
hide : true
}, {
display : 'Number Code',
name : 'numcode',
width : 80,
sortable : true,
align : 'right'
} ],
buttons : [ {
name : 'Add',
bclass : 'add',
onpress : test
}, {
name : 'Delete',
bclass : 'delete',
onpress : test
}, {
separator : true
} ],
searchitems : [ {
display : 'ISO',
name : 'iso'
}, {
display : 'Name',
name : 'name',
isdefault : true
} ],
sortname : "iso",
sortorder : "asc",
usepager : true,
title : 'Countries',
useRp : true,
rp : 15,
showTableToggleBtn : true,
width : 700,
height : 200
});
function test(com, grid) {
if (com == 'Delete') {
confirm('Delete ' + $('.trSelected', grid).length + ' items?')
} else if (com == 'Add') {
alert('Add New Item');
}
}
</script>
</body>
</html>