Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Support for multiple rows in thead #1

Merged
merged 2 commits into from about 1 year ago

2 participants

Dan Patrick limodou
Dan Patrick

Hey, your branch looks more up-to-date what with the changes for bootstrap and all. Here's something I added.

Dan Patrick

Ugh, looks like my IDE didnt like the original formatting. Relevant block is line 240 through 260.

limodou limodou merged commit c563726 into from April 02, 2013
limodou limodou closed this April 02, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Apr 01, 2013
Dan Patrick Merge pull request #1 from limodou/master
Updates for bootstrap theme
742b5a0
Dan Patrick Support for multiple tr in thead c0b095e
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 488 additions and 462 deletions. Show diff stats Hide diff stats

  1. 950  javascript/jquery.fixheadertable.js
950  javascript/jquery.fixheadertable.js
@@ -6,7 +6,7 @@
6 6
 *
7 7
 * Licensed under MIT
8 8
 * http://www.opensource.org/licenses/mit-license.php
9  
-* 
  9
+*
10 10
 * http://docs.jquery.com/Plugins/Authoring
11 11
 * jQuery authoring guidelines
12 12
 *
@@ -14,989 +14,1015 @@
14 14
 * Version : 2.0
15 15
 */
16 16
 
17  
-(function($) { 
  17
+(function($) {
18 18
 
19 19
 	$.fn.fixheadertable = function(options) {
20 20
 
21  
-		var defaults = {  
22  
-				
  21
+		var defaults = {
  22
+
23 23
 			caption		 : '',
24  
-			
  24
+
25 25
 			showhide	 : true,
26  
-			
  26
+
27 27
 			theme		 : 'ui',
28  
-			
  28
+
29 29
 			height		 : null,
30  
-			
31  
-			width		 : null, 
32  
-			
  30
+
  31
+			width		 : null,
  32
+
33 33
 			minWidth	 : null,
34  
-			
  34
+
35 35
 			minWidthAuto : false,
36  
-			
  36
+
37 37
 			colratio	 : [],
38  
-			
  38
+
39 39
 			whiteSpace	 : 'nowrap',
40  
-			
  40
+
41 41
 			addTitles	 : false,
42  
-			
  42
+
43 43
 			zebra		 : false,
44  
-			
  44
+
45 45
 			zebraClass	 : 'ui-state-active',
46  
-			
47  
-			sortable	 : false, 
48  
-			
  46
+
  47
+			sortable	 : false,
  48
+
49 49
 			sortedColId	 : null,
50  
-			
  50
+
51 51
 			sortType	 : [],
52  
-			
  52
+
53 53
 			dateFormat	 : 'd-m-y',
54  
-			
  54
+
55 55
 			pager		 : false,
56  
-			
  56
+
57 57
 			rowsPerPage	 : 10,
58  
-			
  58
+
59 59
 			resizeCol	 : false,
60  
-			
  60
+
61 61
 			minColWidth	 : 100,
62  
-			
  62
+
63 63
 			wrapper		 : true
64  
-		};  
65  
-		
66  
-		var options = $.extend(defaults, options); 
67  
-		
  64
+		};
  65
+
  66
+		var options = $.extend(defaults, options);
  67
+
68 68
 		function util_getComputedStyle(element, property) {
69  
-			
  69
+
70 70
 			if (element.currentStyle) {
71  
-				
  71
+
72 72
 				var y = x.currentStyle[property];
73  
-				
  73
+
74 74
 			} else if (window.getComputedStyle) {
75  
-				
  75
+
76 76
 				var y = document.defaultView.getComputedStyle(element, null).getPropertyValue(property);
77 77
 			}
78  
-			
  78
+
79 79
 			return y;
80 80
 		}
81  
-		
  81
+
82 82
 		function util_getScrollbarWidth () {
83  
-						
  83
+
84 84
 			var inner = $('<p/>').addClass('t_fixed_header_scroll_inner');
85  
-			
  85
+
86 86
 			var outer = $('<div/>').addClass('t_fixed_header_scroll_outer');
87  
-			
  87
+
88 88
 			outer.append(inner);
89  
-			
  89
+
90 90
 			$(document.body).append(outer);
91  
-			
92  
-			var w1 = inner[0].offsetWidth;  
93  
-			
  91
+
  92
+			var w1 = inner[0].offsetWidth;
  93
+
94 94
 			outer.css('overflow', 'scroll');
95  
-			
96  
-			var w2 = inner[0].offsetWidth;  
97  
-			
98  
-			if (w1 == w2) w2 = outer[0].clientWidth;  
99  
-			
  95
+
  96
+			var w2 = inner[0].offsetWidth;
  97
+
  98
+			if (w1 == w2) w2 = outer[0].clientWidth;
  99
+
100 100
 			outer.remove();
101  
-			
102  
-			return (w1 - w2);			
  101
+
  102
+			return (w1 - w2);
103 103
 		}
104  
-		
  104
+
105 105
 		function util_parseDate (format, date) {
106 106
                 /*
107 107
                 * Function taken to jqGrid
108  
-                * Thanks to jqGrid 
  108
+                * Thanks to jqGrid
109 109
                 * Author: Mark Williams
110 110
                 * Dual licensed under the MIT and GPL licenses:
111 111
                 * http://www.opensource.org/licenses/mit-license.php
112 112
                 * http://www.gnu.org/licenses/gpl-2.0.html
113 113
                 */
114 114
 			var tsp = {m : 1, d : 1, y : 1970, h : 0, i : 0, s : 0}, k, hl, dM;
115  
-			
  115
+
116 116
 			if(date && date !== null && date !== undefined){
117  
-				
  117
+
118 118
 				date = $.trim(date);
119  
-				
  119
+
120 120
 				date = date.split(/[\\\/:_;.\t\T\s-]/);
121  
-				
  121
+
122 122
 				format = format.split(/[\\\/:_;.\t\T\s-]/);
123  
-				
  123
+
124 124
 				var dfmt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
125  
-				
  125
+
126 126
 				var afmt = ["am", "pm", "AM", "PM"];
127  
-				
  127
+
128 128
 				var h12to24 = function(ampm, h){
129  
-					
  129
+
130 130
 					if (ampm === 0){ if (h == 12) { h = 0;} }
131  
-					
  131
+
132 132
 					else { if (h != 12) { h += 12; } }
133  
-					
  133
+
134 134
 					return h;
135 135
 				};
136  
-				
  136
+
137 137
 				for (k=0, hl=format.length; k < hl; k++){
138  
-					
  138
+
139 139
 					if(format[k] == 'M') {
140  
-						
  140
+
141 141
 						dM = $.inArray(date[k],dfmt);
142  
-						
  142
+
143 143
 						if(dM !== -1 && dM < 12){date[k] = dM+1;}
144 144
 					}
145  
-					
  145
+
146 146
 					if(format[k] == 'F') {
147  
-						
  147
+
148 148
 						dM = $.inArray(date[k],dfmt);
149  
-						
  149
+
150 150
 						if(dM !== -1 && dM > 11){date[k] = dM+1-12;}
151 151
 					}
152  
-					
  152
+
153 153
 					if(format[k] == 'a') {
154  
-						
  154
+
155 155
 						dM = $.inArray(date[k],afmt);
156  
-						
  156
+
157 157
 						if(dM !== -1 && dM < 2 && date[k] == afmt[dM]){
158  
-							
  158
+
159 159
 							date[k] = dM;
160  
-							
  160
+
161 161
 							tsp.h = h12to24(date[k], tsp.h);
162 162
 						}
163 163
 					}
164  
-					
  164
+
165 165
 					if(format[k] == 'A') {
166  
-						
  166
+
167 167
 						dM = $.inArray(date[k],afmt);
168  
-						
  168
+
169 169
 						if(dM !== -1 && dM > 1 && date[k] == afmt[dM]){
170  
-							
  170
+
171 171
 							date[k] = dM-2;
172  
-							
  172
+
173 173
 							tsp.h = h12to24(date[k], tsp.h);
174 174
 						}
175 175
 					}
176  
-					
  176
+
177 177
 					if(date[k] !== undefined) {
178  
-						
  178
+
179 179
 						tsp[format[k].toLowerCase()] = parseInt(date[k],10);
180 180
 					}
181 181
 				}
182  
-				
  182
+
183 183
 				tsp.m = parseInt(tsp.m,10)-1;
184  
-				
  184
+
185 185
 				var ty = tsp.y;
186  
-				
  186
+
187 187
 				if (ty >= 70 && ty <= 99) {tsp.y = 1900 + tsp.y;}
188  
-				
  188
+
189 189
 				else if (ty >=0 && ty <=69) {tsp.y= 2000 + tsp.y;}
190 190
 			}
191  
-			
  191
+
192 192
 			return new Date(tsp.y, tsp.m, tsp.d, tsp.h, tsp.i, tsp.s,0);
193 193
 		}
194  
-		
  194
+
195 195
 		return this.each(function() {
196  
-			
  196
+
197 197
 			var _table				= $(this);
198  
-			
  198
+
199 199
 			var main_wrapper		= null;
200  
-			
201  
-			var nbcol 				= $('thead th', this).length;
202  
-			
  200
+
  201
+			var nbcol 				= getNbcol(_table);
  202
+
203 203
 			var _initialWidth		= $(this).width();
204  
-			
  204
+
205 205
 			var _wrapper 			= null;
206  
-			
  206
+
207 207
 			var _headerscontainer	= null;
208  
-			
  208
+
209 209
 			var _fillScrollbar 		= null;
210  
-			
  210
+
211 211
 			var _body 				= null;
212  
-			
  212
+
213 213
 			var _headers			= null;
214  
-			
  214
+
215 215
 			var _scrollWidth		= util_getScrollbarWidth();
216  
-			
  216
+
217 217
 			var _colgroup			= buildColgroup(nbcol);
218  
-			
  218
+
219 219
 			var _colgroup_body		= null;
220  
-			
  220
+
221 221
 			var _nbRowsPerPage		= 10;
222  
-			
  222
+
223 223
 			var _new_nbRowsPerPage  = null;
224  
-			
  224
+
225 225
 			var _nbpages			= null;
226  
-			
  226
+
227 227
 			var _nbpagesDiv			= null;
228  
-			
  228
+
229 229
 			var _currentpage 		= null;
230  
-			
  230
+
231 231
 			var _pager				= null;
232  
-			
  232
+
233 233
 			var _objectTable		= null;
234  
-			
  234
+
235 235
 			var _stripNum 			= /[\$,%]/g;
236  
-			
  236
+
237 237
 			var _resizeInfo 		= null;
238  
-			
  238
+
239 239
 			var _resizeGhost		= null;
240  
-			
  240
+
  241
+			function getNbcol(table) {
  242
+				var thead = table.find('thead');
  243
+				var cols = [];
  244
+				var theadrow;
  245
+
  246
+				if (theadrow = thead.find('tr:first')) {
  247
+					thead = theadrow
  248
+				}
  249
+
  250
+				var colspan;
  251
+				thead.find('th').each(function(i,el) {
  252
+					if (colspan = $(el).attr('colspan')) {
  253
+						cols.push(parseInt(colspan));
  254
+					}
  255
+					else {
  256
+						cols.push(1);
  257
+					}
  258
+				});
  259
+
  260
+				var sum = 0;
  261
+				$.each(cols, function(index) { sum += cols[index] });
  262
+
  263
+				console.log(sum);
  264
+				return sum;
  265
+			}
  266
+
241 267
 			function buildTop (table) {
242  
-				
  268
+
243 269
 				_fillScrollbar = $('<div class="headtable ui-state-default" style="margin-right : 0px"></div>');
244  
-				
  270
+
245 271
 				_headerscontainer = _fillScrollbar;
246  
-				
  272
+
247 273
 				_headerscontainer.insertBefore(table);
248 274
 			}
249  
-			
  275
+
250 276
 			function buildColgroup (nbcol) {
251  
-					
252  
-				var colgroup = $('<colgroup />');				
253  
-				
  277
+
  278
+				var colgroup = $('<colgroup />');
  279
+
254 280
 				if (options.colratio.length == 0) {
255  
-				
  281
+
256 282
 					var temp = null;
257  
-					
  283
+
258 284
 					for (var i = 0; i < nbcol; i++) {
259  
-						
  285
+
260 286
 						temp = $('<col style="width : ' + (100/nbcol) + '%" />');
261  
-						
  287
+
262 288
 						colgroup.append(temp);
263 289
 
264 290
 						temp = null;
265 291
 					}
266  
-				
  292
+
267 293
 				} else if (options.colratio.length == nbcol) {
268  
-					
  294
+
269 295
 					var cw = 0;
270  
-					
  296
+
271 297
 					for (var i = 0; i < nbcol; i++) {
272  
-						
  298
+
273 299
 						temp = $('<col style="width : ' + options.colratio[i] + 'px" />');
274  
-						
  300
+
275 301
 						colgroup.append(temp);
276 302
 
277 303
 						temp = null;
278  
-						
  304
+
279 305
 						cw += parseInt(options.colratio[i]);
280 306
 					}
281  
-					
  307
+
282 308
 					$(_table).css('width', cw + 'px');
283 309
 				}
284  
-				
  310
+
285 311
 				return colgroup;
286 312
 			}
287  
-			
  313
+
288 314
 			function sortColumn (table, number, sens, th) {
289 315
 			       /*
290 316
                                 * Function inspired by jqGrid
291 317
                                 * Author: Mark Williams
292 318
                                 */
293 319
 				if ((options.sortType.length != 0) && (options.sortType.length == nbcol)) {
294  
-					
  320
+
295 321
 					var type = options.sortType[number];
296  
-					
297  
-					if (type == 'float') {						
298  
-						
  322
+
  323
+					if (type == 'float') {
  324
+
299 325
 						getSortKey = function(cell) {
300  
-							
  326
+
301 327
 							var key = parseFloat( String(cell).replace(_stripNum, ''));
302  
-							
  328
+
303 329
 							return isNaN(key) ? 0.00 : key;
304 330
 						}
305  
-						
  331
+
306 332
 					} else if (type == 'integer') {
307  
-						
  333
+
308 334
 						getSortKey = function(cell) {
309  
-							
310  
-							return cell ? parseFloat(String(cell).replace(_stripNum, '')) : 0;							
  335
+
  336
+							return cell ? parseFloat(String(cell).replace(_stripNum, '')) : 0;
311 337
 						}
312  
-						
  338
+
313 339
 					} else if (type == 'date') {
314  
-						
  340
+
315 341
 						getSortKey = function(cell) {
316  
-							
  342
+
317 343
 							return util_parseDate(options.dateFormat, cell).getTime();
318 344
 						}
319  
-						
  345
+
320 346
 					} else {
321  
-						
  347
+
322 348
 						getSortKey = function(cell) {
323  
-							
  349
+
324 350
 							if(!cell) { cell =""; }
325  
-							
  351
+
326 352
 							return $.trim(String(cell).toLowerCase());
327 353
 						}
328 354
 					}
329  
-					
  355
+
330 356
 				} else {
331  
-					
  357
+
332 358
 					getSortKey = function(cell) {
333  
-						
  359
+
334 360
 						if(!cell) { cell =""; }
335  
-						
  361
+
336 362
 						return $.trim(String(cell).toLowerCase());
337 363
 					}
338 364
 				}
339  
-				
  365
+
340 366
 				_objectTable.sort(function(a, b){
341  
-										
  367
+
342 368
 					var x = getSortKey(a[number]);
343  
-					
  369
+
344 370
 				    var y = getSortKey(b[number]);
345  
-				    
  371
+
346 372
 				    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
347 373
 				})
348  
-					
  374
+
349 375
 				if(sens == 'DESC'){
350  
-					
  376
+
351 377
 					_objectTable.reverse();
352 378
 				}
353  
-				
  379
+
354 380
 				(options.pager) ? moveToPage(table) : objectToTable(_objectTable, table);
355 381
 			}
356  
-			
  382
+
357 383
 			function objectToTable(objectArray, table) {
358  
-				
  384
+
359 385
 				var body = $('tbody', table);
360  
-								
  386
+
361 387
 				body.children().remove();
362  
-				
  388
+
363 389
 				if(options.zebra){
364  
-					
  390
+
365 391
 					for (var i = 0; i < objectArray.length; i++){
366  
-						
367  
-						(i%2) ? (tr = $('<tr class="' + options.zebraClass + '"></tr>')) : (tr = $('<tr></tr>'));									
368  
-						
  392
+
  393
+						(i%2) ? (tr = $('<tr class="' + options.zebraClass + '"></tr>')) : (tr = $('<tr></tr>'));
  394
+
369 395
 						for (var j in objectArray[i]){
370  
-							
  396
+
371 397
 							tr.append($('<td class="ui-widget-content"></td>').html(objectArray[i][j]));
372  
-						}	
373  
-						
  398
+						}
  399
+
374 400
 						body.append(tr);
375 401
 					}
376  
-					
  402
+
377 403
 				} else {
378  
-				
  404
+
379 405
 					for (var i = 0; i < objectArray.length; i++){
380  
-							
381  
-						tr = $('<tr></tr>');				
382  
-						
  406
+
  407
+						tr = $('<tr></tr>');
  408
+
383 409
 						for (var j in objectArray[i]){
384  
-							
  410
+
385 411
 							tr.append($('<td class="ui-widget-content"></td>').html(objectArray[i][j]));
386  
-						}	
387  
-						
  412
+						}
  413
+
388 414
 						body.append(tr);
389 415
 					}
390 416
 				}
391 417
 			}
392  
-			
  418
+
393 419
 			function tableToObject(table) {
394 420
 
395 421
 				var objectArray = [];
396  
-				
  422
+
397 423
 				$('tr', table).each(function(i){
398  
-					
  424
+
399 425
 					var data = {};
400  
-					
  426
+
401 427
 					$('td', this).each(function(j){
402  
-						
  428
+
403 429
 						data[j] = $(this).html();
404 430
 					})
405  
-					
  431
+
406 432
 					objectArray.push(data);
407  
-				});	
  433
+				});
408 434
 
409 435
 				return objectArray;
410 436
 			}
411  
-			
  437
+
412 438
 			function buildHeaders(table) {
413  
-				
  439
+
414 440
 				_headers = $('<table class="head '+table.className+'"/>').append(_colgroup).append($('thead', table));
415  
-				
416  
-				_headerscontainer.append(_headers);	
417  
-				
  441
+
  442
+				_headerscontainer.append(_headers);
  443
+
418 444
 				_headers.wrap('<div></div>');
419  
-				
  445
+
420 446
 				var tab_headers = $('th', _headers);
421  
-				
  447
+
422 448
 				tab_headers.addClass('ui-widget-content ui-state-default');
423  
-								
  449
+
424 450
 				if(options.sortable){
425  
-					
  451
+
426 452
 					var th_div_sort = null;
427  
-					
  453
+
428 454
 					tab_headers.each(function(i){
429  
-						
  455
+
430 456
 						$(this).contents().wrapAll('<div class="ui-sort"></div>');
431  
-						
  457
+
432 458
 						th_div_sort = $('div.ui-sort', this);
433  
-						
  459
+
434 460
 						th_div_sort.click(function(){
435  
-							
  461
+
436 462
 							tab_headers.removeClass('ui-state-hover');
437  
-							
  463
+
438 464
 							$(this).parent().removeClass('ui-state-active').addClass('ui-state-hover');
439  
-							
  465
+
440 466
 							$('span.ui-icon', tab_headers).remove();
441  
-							
  467
+
442 468
 							if($(this).hasClass('sortedUp')){
443  
-								
  469
+
444 470
 								sortColumn(table, i, "DESC", this);
445  
-								
  471
+
446 472
 								$(this).removeClass('sortedUp').addClass('sortedDown');
447  
-								
  473
+
448 474
 								$(this).append('<span style="display : inline-block; vertical-align : middle" class="ui-icon ui-icon-triangle-1-s"></span>');
449  
-								
  475
+
450 476
 							} else {
451  
-								
  477
+
452 478
 								sortColumn(table, i, "ASC", this);
453  
-								
  479
+
454 480
 								$(this).removeClass('sortedDown').addClass('sortedUp');
455  
-								
  481
+
456 482
 								$(this).append('<span style="display : inline-block; vertical-align : middle" class="ui-icon ui-icon-triangle-1-n"></span>');
457 483
 							}
458  
-							
  484
+
459 485
 							_headerscontainer[0].scrollLeft = _body[0].scrollLeft;
460 486
 						})
461 487
 					});
462  
-				    
  488
+
463 489
 					$('div.ui-sort', tab_headers).addClass('hover');
464 490
 				}
465  
-				
  491
+
466 492
 				if(options.resizeCol && (options.colratio.length == nbcol)){
467  
-					
  493
+
468 494
 					tab_headers.each(function(i){
469  
-						
  495
+
470 496
 						var resizer = $('<span class="ui-resize"></span>');
471  
-						
  497
+
472 498
 						$(this).prepend(resizer);
473  
-						
  499
+
474 500
 						resizer.mousedown(function(e){
475  
-							
  501
+
476 502
 							dragStart(i, e);
477  
-							
  503
+
478 504
 							return false;
479  
-						})						
  505
+						})
480 506
 					});
481  
-					
  507
+
482 508
 					_main_wrapper.mousemove(function(e){
483  
-						
  509
+
484 510
 						if (_resizeInfo){
485  
-							
  511
+
486 512
 							dragMove(e);
487  
-							
  513
+
488 514
 							return false;
489 515
 						}
490 516
 					}).mouseup(function(){
491  
-						
  517
+
492 518
 						if (_resizeInfo){
493  
-							
  519
+
494 520
 							dragEnd();
495  
-							
  521
+
496 522
 							return false;
497 523
 						}
498  
-						
  524
+
499 525
 						return true;
500 526
 					});
501  
-					
  527
+
502 528
 					function getOffset(col){
503  
-						
  529
+
504 530
 						var ret = 0, cell = $('col', _colgroup), handler = $('th > span.ui-resize', _headers)[col], bso = _body[0].scrollLeft;
505  
-						
  531
+
506 532
 						for(var i = 0; i < col; i++){
507  
-							
  533
+
508 534
 							ret += parseInt(cell[i].style.width);
509 535
 						}
510  
-						
  536
+
511 537
 						return handler.offsetLeft + 5 + ret - bso;
512 538
 					}
513  
-					
  539
+
514 540
 					function dragStart(i, x){
515  
-						
  541
+
516 542
 						_resizeInfo = { id : i, startX : x.clientX , initTableWidth : getColratioWidth(), offset : getOffset(i) };
517  
-						
  543
+
518 544
 						_resizeGhost.css({ display : 'block', height : _headerscontainer.height() + _body.height() + 2 + 'px', left : _resizeInfo.offset + 'px', cursor : 'col-resize' });
519 545
 					}
520  
-					
  546
+
521 547
 					function dragMove(x){
522  
-						
  548
+
523 549
 						var diff = x.clientX - _resizeInfo.startX;
524  
-						
  550
+
525 551
 						_resizeInfo.newWidth = parseInt($('col', _colgroup)[_resizeInfo.id].style.width) + diff;
526  
-						
  552
+
527 553
 						_resizeInfo.newTableWidth = _resizeInfo.initTableWidth + diff;
528  
-						
  554
+
529 555
 						if(_resizeInfo.newWidth > parseInt(options.minColWidth)){
530  
-						
  556
+
531 557
 							_resizeGhost.css({ left :  _resizeInfo.offset + diff + 'px' });
532  
-							
  558
+
533 559
 						} else {
534  
-							
  560
+
535 561
 							_resizeInfo.newWidth = parseInt(options.minColWidth);
536 562
 						}
537 563
 					}
538  
-					
  564
+
539 565
 					function dragEnd(){
540  
-						
  566
+
541 567
 						$(_colgroup.children()[_resizeInfo.id]).css({ width : _resizeInfo.newWidth + 'px' });
542  
-						
  568
+
543 569
 						$(_colgroup_body.children()[_resizeInfo.id]).css({ width : _resizeInfo.newWidth + 'px' });
544  
-						
  570
+
545 571
 						var wrapper_width = _resizeInfo.newTableWidth;
546  
-						
  572
+
547 573
 						_headers.css({ 'width' : wrapper_width + 'px' });
548  
-						
  574
+
549 575
 						$(_table).css({ 'width'	: wrapper_width + 'px' });
550  
-							
  576
+
551 577
 						_resizeInfo = null;
552  
-						
  578
+
553 579
 						_resizeGhost.css({ display : 'none' });
554  
-						
  580
+
555 581
 						_headerscontainer[0].scrollLeft = _body[0].scrollLeft;
556 582
 					}
557 583
 				}
558 584
 			}
559 585
 
560 586
 			function isIE6_7() {
561  
-				
  587
+
562 588
 				if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
563  
-					
  589
+
564 590
 	        		var ieversion = new Number(RegExp.$1);
565  
-	        		 
  591
+
566 592
 	 				if (ieversion == 7 || ieversion == 6) {
567  
-	 					
  593
+
568 594
 	        				return true;
569  
-	        				
  595
+
570 596
 	        		} else {
571 597
 	        				return false;
572 598
 	        		}
573 599
 	        	}
574 600
 			}
575  
-			
  601
+
576 602
 			function isIE8() {
577  
-				
  603
+
578 604
 				if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
579  
-					
  605
+
580 606
 	        		var ieversion = new Number(RegExp.$1);
581  
-	        		 
  607
+
582 608
 	 				if (ieversion == 8) {
583  
-	 					
  609
+
584 610
 	        				return true;
585  
-	        				
  611
+
586 612
 	        		} else {
587 613
 	        				return false;
588 614
 	        		}
589 615
 	        	}
590 616
 			}
591  
-			
  617
+
592 618
 			function buildBody (table) {
593  
-				
  619
+
594 620
 				_body = $('<div class="body ui-widget-content"></div>').insertBefore(table).append(table);
595  
-				
596  
-				if(options.height != null &&  !isNaN(parseInt(options.height))) {
597  
-				
  621
+
  622
+				if(options.height != null && !isNaN(parseInt(options.height))) {
  623
+
598 624
 					_body.css('height', options.height + 'px');
599 625
 				}
600  
-				
  626
+
601 627
 				_colgroup_body = _colgroup.clone();
602  
-				
  628
+
603 629
 				$(table).prepend(_colgroup_body);
604  
-				
  630
+
605 631
 				$('td', table).addClass('ui-widget-content');
606  
-				
  632
+
607 633
 				$(table).wrap('<div></div>');
608  
-				
  634
+
609 635
 				if (options.addTitles == true) {
610  
-				
  636
+
611 637
 					$('td', table).each(function() {
612  
-						
  638
+
613 639
 							$(this).attr('title', $(this).text());
614  
-					});			
  640
+					});
615 641
 				}
616  
-				
  642
+
617 643
 				if (options.zebra) {
618  
-					
  644
+
619 645
 					$('tr:odd', table).addClass(options.zebraClass);
620 646
 				}
621 647
 			}
622  
-			
  648
+
623 649
 			function adaptScroll (table) {
624  
-				
  650
+
625 651
 				var scrollwidth = _scrollWidth;
626  
-	        	
  652
+
627 653
 	        	if(isIE6_7()){
628  
-	        		
629  
-	        		scrollwidth = 0; 
  654
+
  655
+	        		scrollwidth = 0;
630 656
 	        	}
631  
-	        	
  657
+
632 658
 	        	var width = 0;
633  
-	        							
634  
-				if (parseInt($(table).height()) > parseInt(options.height)) { 
635  
-									
  659
+
  660
+				if (parseInt($(table).height()) > parseInt(options.height)) {
  661
+
636 662
 					width = scrollwidth;
637  
-					
  663
+
638 664
 					overflow = 'scroll';
639  
-					
640  
-				} else { 
641  
-									
  665
+
  666
+				} else {
  667
+
642 668
 					width = 0;
643  
-						
  669
+
644 670
 					overflow = 'auto';
645 671
 				}
646  
-				
  672
+
647 673
 				if($.browser.msie && options.height) {
648  
-				
  674
+
649 675
 					width = scrollwidth;
650  
-					
  676
+
651 677
 					overflow = 'scroll';
652 678
 				}
653  
-				
  679
+
654 680
 				_fillScrollbar.css('margin-right', width);
655  
-				
656  
-				return overflow;				
  681
+
  682
+				return overflow;
657 683
 			}
658  
-			
  684
+
659 685
 			function restrictRows(table, nbrows) {
660  
-							
  686
+
661 687
 				var length = _objectTable.length;
662  
-				
  688
+
663 689
 				var limit = 0;
664  
-				
  690
+
665 691
 				if(length < nbrows) {
666  
-					
  692
+
667 693
 					limit = length;
668  
-				
  694
+
669 695
 				} else {
670  
-					
  696
+
671 697
 					limit = nbrows;
672 698
 				}
673  
-				
  699
+
674 700
 				var _objectTableSliced = _objectTable.slice(0, limit);
675  
-				
676  
-				objectToTable(_objectTableSliced, table);	
677  
-				
  701
+
  702
+				objectToTable(_objectTableSliced, table);
  703
+
678 704
 				_nbpages = Math.ceil(length / nbrows);
679  
-				
  705
+
680 706
 				_currentpage = 1;
681  
-				
  707
+
682 708
 				_nbpagesDiv.html('Showing page ' + _currentpage + ' of ' + _nbpages);
683  
-				
  709
+
684 710
 				_body.css('overflow-y', adaptScroll(table));
685  
-				
  711
+
686 712
 				$('tr:last td', table).css('border-bottom-width', '1px');
687 713
 			}
688  
-			
  714
+
689 715
 			function moveToNextPage(table) {
690  
-				
  716
+
691 717
 				_currentpage++;
692  
-				
  718
+
693 719
 				if(_currentpage >= (_nbpages)) {
694  
-					
  720
+
695 721
 					_currentpage = (_nbpages);
696 722
 				}
697  
-					
  723
+
698 724
 				moveToPage(table);
699 725
 			}
700  
-			
  726
+
701 727
 			function moveToPreviousPage(table) {
702  
-				
  728
+
703 729
 				_currentpage--;
704  
-				
  730
+
705 731
 				if(_currentpage <= 1) {
706  
-					
  732
+
707 733
 					_currentpage = 1;
708 734
 				}
709  
-				
  735
+
710 736
 				moveToPage(table);
711 737
 			}
712  
-			
  738
+
713 739
 			function moveToPage(table) {
714  
-				
  740
+
715 741
 				var length = _objectTable.length;
716  
-				
  742
+
717 743
 				var start, limit = 0;
718  
-				
  744
+
719 745
 				start = (_currentpage - 1) * _new_nbRowsPerPage;
720  
-				
  746
+
721 747
 				if(length < (_currentpage * _new_nbRowsPerPage)) {
722  
-					
  748
+