datatables-rails-bs3 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +15 -0
  2. data/lib/datatables-rails-bs3.rb +2 -0
  3. data/lib/jquery/datatables/rails/engine.rb +11 -0
  4. data/lib/jquery/datatables/rails/version.rb +7 -0
  5. data/vendor/assets/images/dataTables/back_disabled.png +0 -0
  6. data/vendor/assets/images/dataTables/back_enabled.png +0 -0
  7. data/vendor/assets/images/dataTables/back_enabled_hover.png +0 -0
  8. data/vendor/assets/images/dataTables/extras/background.png +0 -0
  9. data/vendor/assets/images/dataTables/extras/collection.png +0 -0
  10. data/vendor/assets/images/dataTables/extras/collection_hover.png +0 -0
  11. data/vendor/assets/images/dataTables/extras/copy.png +0 -0
  12. data/vendor/assets/images/dataTables/extras/copy_hover.png +0 -0
  13. data/vendor/assets/images/dataTables/extras/csv.png +0 -0
  14. data/vendor/assets/images/dataTables/extras/csv_hover.png +0 -0
  15. data/vendor/assets/images/dataTables/extras/pdf.png +0 -0
  16. data/vendor/assets/images/dataTables/extras/pdf_hover.png +0 -0
  17. data/vendor/assets/images/dataTables/extras/print.png +0 -0
  18. data/vendor/assets/images/dataTables/extras/print_hover.png +0 -0
  19. data/vendor/assets/images/dataTables/extras/xls.png +0 -0
  20. data/vendor/assets/images/dataTables/extras/xls_hover.png +0 -0
  21. data/vendor/assets/images/dataTables/favicon.ico +0 -0
  22. data/vendor/assets/images/dataTables/forward_disabled.png +0 -0
  23. data/vendor/assets/images/dataTables/forward_enabled.png +0 -0
  24. data/vendor/assets/images/dataTables/forward_enabled_hover.png +0 -0
  25. data/vendor/assets/images/dataTables/sort_asc.png +0 -0
  26. data/vendor/assets/images/dataTables/sort_asc_disabled.png +0 -0
  27. data/vendor/assets/images/dataTables/sort_both.png +0 -0
  28. data/vendor/assets/images/dataTables/sort_desc.png +0 -0
  29. data/vendor/assets/images/dataTables/sort_desc_disabled.png +0 -0
  30. data/vendor/assets/javascripts/dataTables/extras/AutoFill.js +820 -0
  31. data/vendor/assets/javascripts/dataTables/extras/ColReorder.js +956 -0
  32. data/vendor/assets/javascripts/dataTables/extras/ColVis.js +1013 -0
  33. data/vendor/assets/javascripts/dataTables/extras/FixedColumns.js +1240 -0
  34. data/vendor/assets/javascripts/dataTables/extras/FixedHeader.js +937 -0
  35. data/vendor/assets/javascripts/dataTables/extras/KeyTable.js +1111 -0
  36. data/vendor/assets/javascripts/dataTables/extras/Scroller.js +904 -0
  37. data/vendor/assets/javascripts/dataTables/extras/TableTools.js +2424 -0
  38. data/vendor/assets/javascripts/dataTables/extras/TableTools.min.js +76 -0
  39. data/vendor/assets/javascripts/dataTables/extras/ZeroClipboard.js +367 -0
  40. data/vendor/assets/javascripts/dataTables/jquery.dataTables.api.fnFilterOnReturn.js +17 -0
  41. data/vendor/assets/javascripts/dataTables/jquery.dataTables.api.fnGetColumnData.js +54 -0
  42. data/vendor/assets/javascripts/dataTables/jquery.dataTables.api.fnReloadAjax.js +44 -0
  43. data/vendor/assets/javascripts/dataTables/jquery.dataTables.api.fnSetFilteringDelay.js +32 -0
  44. data/vendor/assets/javascripts/dataTables/jquery.dataTables.bootstrap.js +383 -0
  45. data/vendor/assets/javascripts/dataTables/jquery.dataTables.js +12098 -0
  46. data/vendor/assets/javascripts/dataTables/jquery.dataTables.sorting.numbersHtml.js +15 -0
  47. data/vendor/assets/javascripts/dataTables/jquery.dataTables.typeDetection.numbersHtml.js +40 -0
  48. data/vendor/assets/media/dataTables/extras/as3/ZeroClipboard.as +221 -0
  49. data/vendor/assets/media/dataTables/extras/as3/ZeroClipboardPdf.as +310 -0
  50. data/vendor/assets/media/dataTables/extras/as3/lib/AlivePDF.swc +0 -0
  51. data/vendor/assets/media/dataTables/extras/swf/copy_csv_xls.swf +0 -0
  52. data/vendor/assets/media/dataTables/extras/swf/copy_csv_xls_pdf.swf +0 -0
  53. data/vendor/assets/stylesheets/dataTables/extras/TableTools.css +314 -0
  54. data/vendor/assets/stylesheets/dataTables/extras/TableTools_JUI.css +185 -0
  55. data/vendor/assets/stylesheets/dataTables/jquery.dataTables.bootstrap.css.scss +177 -0
  56. data/vendor/assets/stylesheets/dataTables/jquery.dataTables.css.scss +220 -0
  57. data/vendor/assets/stylesheets/dataTables/src/demo_page.css +107 -0
  58. data/vendor/assets/stylesheets/dataTables/src/demo_table.css +575 -0
  59. data/vendor/assets/stylesheets/dataTables/src/demo_table_jui.css +530 -0
  60. data/vendor/assets/stylesheets/dataTables/src/jquery.dataTables_themeroller.css +243 -0
  61. metadata +116 -0
@@ -0,0 +1,1240 @@
1
+ /**
2
+ * @summary FixedColumns
3
+ * @description Freeze columns in place on a scrolling DataTable
4
+ * @file FixedColumns.js
5
+ * @version 2.0.4.dev
6
+ * @author Allan Jardine (www.sprymedia.co.uk)
7
+ * @license GPL v2 or BSD 3 point style
8
+ * @contact www.sprymedia.co.uk/contact
9
+ *
10
+ * @copyright Copyright 2010-2011 Allan Jardine, all rights reserved.
11
+ *
12
+ * This source file is free software, under either the GPL v2 license or a
13
+ * BSD style license, available at:
14
+ * http://datatables.net/license_gpl2
15
+ * http://datatables.net/license_bsd
16
+ */
17
+
18
+
19
+ /* Global scope for FixedColumns */
20
+ var FixedColumns;
21
+
22
+ (function($, window, document) {
23
+
24
+
25
+ /**
26
+ * When making use of DataTables' x-axis scrolling feature, you may wish to
27
+ * fix the left most column in place. This plug-in for DataTables provides
28
+ * exactly this option (note for non-scrolling tables, please use the
29
+ * FixedHeader plug-in, which can fix headers, footers and columns). Key
30
+ * features include:
31
+ * <ul class="limit_length">
32
+ * <li>Freezes the left or right most columns to the side of the table</li>
33
+ * <li>Option to freeze two or more columns</li>
34
+ * <li>Full integration with DataTables' scrolling options</li>
35
+ * <li>Speed - FixedColumns is fast in its operation</li>
36
+ * </ul>
37
+ *
38
+ * @class
39
+ * @constructor
40
+ * @param {object} oDT DataTables instance
41
+ * @param {object} [oInit={}] Configuration object for FixedColumns. Options are defined by {@link FixedColumns.defaults}
42
+ *
43
+ * @requires jQuery 1.3+
44
+ * @requires DataTables 1.8.0+
45
+ *
46
+ * @example
47
+ * var oTable = $('#example').dataTable( {
48
+ * "sScrollX": "100%"
49
+ * } );
50
+ * new FixedColumns( oTable );
51
+ */
52
+ FixedColumns = function ( oDT, oInit ) {
53
+ /* Sanity check - you just know it will happen */
54
+ if ( ! this instanceof FixedColumns )
55
+ {
56
+ alert( "FixedColumns warning: FixedColumns must be initialised with the 'new' keyword." );
57
+ return;
58
+ }
59
+
60
+ if ( typeof oInit == 'undefined' )
61
+ {
62
+ oInit = {};
63
+ }
64
+
65
+ /**
66
+ * Settings object which contains customisable information for FixedColumns instance
67
+ * @namespace
68
+ * @extends FixedColumns.defaults
69
+ */
70
+ this.s = {
71
+ /**
72
+ * DataTables settings objects
73
+ * @type object
74
+ * @default Obtained from DataTables instance
75
+ */
76
+ "dt": oDT.fnSettings(),
77
+
78
+ /**
79
+ * Number of columns in the DataTable - stored for quick access
80
+ * @type int
81
+ * @default Obtained from DataTables instance
82
+ */
83
+ "iTableColumns": oDT.fnSettings().aoColumns.length,
84
+
85
+ /**
86
+ * Original outer widths of the columns as rendered by DataTables - used to calculate
87
+ * the FixedColumns grid bounding box
88
+ * @type array.<int>
89
+ * @default []
90
+ */
91
+ "aiOuterWidths": [],
92
+
93
+ /**
94
+ * Original inner widths of the columns as rendered by DataTables - used to apply widths
95
+ * to the columns
96
+ * @type array.<int>
97
+ * @default []
98
+ */
99
+ "aiInnerWidths": [],
100
+
101
+ /**
102
+ * Flag to indicate if we are dealing with IE6/7 as these browsers need a little hack
103
+ * in the odd place
104
+ * @type boolean
105
+ * @default Automatically calculated
106
+ * @readonly
107
+ */
108
+ "bOldIE": ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0"))
109
+ };
110
+
111
+
112
+ /**
113
+ * DOM elements used by the class instance
114
+ * @namespace
115
+ *
116
+ */
117
+ this.dom = {
118
+ /**
119
+ * DataTables scrolling element
120
+ * @type node
121
+ * @default null
122
+ */
123
+ "scroller": null,
124
+
125
+ /**
126
+ * DataTables header table
127
+ * @type node
128
+ * @default null
129
+ */
130
+ "header": null,
131
+
132
+ /**
133
+ * DataTables body table
134
+ * @type node
135
+ * @default null
136
+ */
137
+ "body": null,
138
+
139
+ /**
140
+ * DataTables footer table
141
+ * @type node
142
+ * @default null
143
+ */
144
+ "footer": null,
145
+
146
+ /**
147
+ * Display grid elements
148
+ * @namespace
149
+ */
150
+ "grid": {
151
+ /**
152
+ * Grid wrapper. This is the container element for the 3x3 grid
153
+ * @type node
154
+ * @default null
155
+ */
156
+ "wrapper": null,
157
+
158
+ /**
159
+ * DataTables scrolling element. This element is the DataTables
160
+ * component in the display grid (making up the main table - i.e.
161
+ * not the fixed columns).
162
+ * @type node
163
+ * @default null
164
+ */
165
+ "dt": null,
166
+
167
+ /**
168
+ * Left fixed column grid components
169
+ * @namespace
170
+ */
171
+ "left": {
172
+ "wrapper": null,
173
+ "head": null,
174
+ "body": null,
175
+ "foot": null
176
+ },
177
+
178
+ /**
179
+ * Right fixed column grid components
180
+ * @namespace
181
+ */
182
+ "right": {
183
+ "wrapper": null,
184
+ "head": null,
185
+ "body": null,
186
+ "foot": null
187
+ }
188
+ },
189
+
190
+ /**
191
+ * Cloned table nodes
192
+ * @namespace
193
+ */
194
+ "clone": {
195
+ /**
196
+ * Left column cloned table nodes
197
+ * @namespace
198
+ */
199
+ "left": {
200
+ /**
201
+ * Cloned header table
202
+ * @type node
203
+ * @default null
204
+ */
205
+ "header": null,
206
+
207
+ /**
208
+ * Cloned body table
209
+ * @type node
210
+ * @default null
211
+ */
212
+ "body": null,
213
+
214
+ /**
215
+ * Cloned footer table
216
+ * @type node
217
+ * @default null
218
+ */
219
+ "footer": null
220
+ },
221
+
222
+ /**
223
+ * Right column cloned table nodes
224
+ * @namespace
225
+ */
226
+ "right": {
227
+ /**
228
+ * Cloned header table
229
+ * @type node
230
+ * @default null
231
+ */
232
+ "header": null,
233
+
234
+ /**
235
+ * Cloned body table
236
+ * @type node
237
+ * @default null
238
+ */
239
+ "body": null,
240
+
241
+ /**
242
+ * Cloned footer table
243
+ * @type node
244
+ * @default null
245
+ */
246
+ "footer": null
247
+ }
248
+ }
249
+ };
250
+
251
+ /* Attach the instance to the DataTables instance so it can be accessed easily */
252
+ this.s.dt.oFixedColumns = this;
253
+
254
+ /* Let's do it */
255
+ this._fnConstruct( oInit );
256
+ };
257
+
258
+
259
+
260
+ FixedColumns.prototype = {
261
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
262
+ * Public methods
263
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
264
+
265
+ /**
266
+ * Update the fixed columns - including headers and footers. Note that FixedColumns will
267
+ * automatically update the display whenever the host DataTable redraws.
268
+ * @returns {void}
269
+ * @example
270
+ * var oTable = $('#example').dataTable( {
271
+ * "sScrollX": "100%"
272
+ * } );
273
+ * var oFC = new FixedColumns( oTable );
274
+ *
275
+ * // at some later point when the table has been manipulated....
276
+ * oFC.fnUpdate();
277
+ */
278
+ "fnUpdate": function ()
279
+ {
280
+ this._fnDraw( true );
281
+ },
282
+
283
+
284
+ /**
285
+ * Recalculate the resizes of the 3x3 grid that FixedColumns uses for display of the table.
286
+ * This is useful if you update the width of the table container. Note that FixedColumns will
287
+ * perform this function automatically when the window.resize event is fired.
288
+ * @returns {void}
289
+ * @example
290
+ * var oTable = $('#example').dataTable( {
291
+ * "sScrollX": "100%"
292
+ * } );
293
+ * var oFC = new FixedColumns( oTable );
294
+ *
295
+ * // Resize the table container and then have FixedColumns adjust its layout....
296
+ * $('#content').width( 1200 );
297
+ * oFC.fnRedrawLayout();
298
+ */
299
+ "fnRedrawLayout": function ()
300
+ {
301
+ this._fnGridLayout();
302
+ },
303
+
304
+
305
+ /**
306
+ * Mark a row such that it's height should be recalculated when using 'semiauto' row
307
+ * height matching. This function will have no effect when 'none' or 'auto' row height
308
+ * matching is used.
309
+ * @param {Node} nTr TR element that should have it's height recalculated
310
+ * @returns {void}
311
+ * @example
312
+ * var oTable = $('#example').dataTable( {
313
+ * "sScrollX": "100%"
314
+ * } );
315
+ * var oFC = new FixedColumns( oTable );
316
+ *
317
+ * // manipulate the table - mark the row as needing an update then update the table
318
+ * // this allows the redraw performed by DataTables fnUpdate to recalculate the row
319
+ * // height
320
+ * oFC.fnRecalculateHeight();
321
+ * oTable.fnUpdate( $('#example tbody tr:eq(0)')[0], ["insert date", 1, 2, 3 ... ]);
322
+ */
323
+ "fnRecalculateHeight": function ( nTr )
324
+ {
325
+ nTr._DTTC_iHeight = null;
326
+ nTr.style.height = 'auto';
327
+ },
328
+
329
+
330
+ /**
331
+ * Set the height of a given row - provides cross browser compatibility
332
+ * @param {Node} nTarget TR element that should have it's height recalculated
333
+ * @param {int} iHeight Height in pixels to set
334
+ * @returns {void}
335
+ * @example
336
+ * var oTable = $('#example').dataTable( {
337
+ * "sScrollX": "100%"
338
+ * } );
339
+ * var oFC = new FixedColumns( oTable );
340
+ *
341
+ * // You may want to do this after manipulating a row in the fixed column
342
+ * oFC.fnSetRowHeight( $('#example tbody tr:eq(0)')[0], 50 );
343
+ */
344
+ "fnSetRowHeight": function ( nTarget, iHeight )
345
+ {
346
+ var jqBoxHack = $(nTarget).children(':first');
347
+ var iBoxHack = jqBoxHack.outerHeight() - jqBoxHack.height();
348
+
349
+ /* Can we use some kind of object detection here?! This is very nasty - damn browsers */
350
+ if ( $.browser.mozilla || $.browser.opera )
351
+ {
352
+ nTarget.style.height = iHeight+"px";
353
+ }
354
+ else
355
+ {
356
+ $(nTarget).children().height( iHeight-iBoxHack );
357
+ }
358
+ },
359
+
360
+
361
+
362
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
363
+ * Private methods (they are of course public in JS, but recommended as private)
364
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
365
+
366
+ /**
367
+ * Initialisation for FixedColumns
368
+ * @param {Object} oInit User settings for initialisation
369
+ * @returns {void}
370
+ * @private
371
+ */
372
+ "_fnConstruct": function ( oInit )
373
+ {
374
+ var i, iLen, iWidth,
375
+ that = this;
376
+
377
+ /* Sanity checking */
378
+ if ( typeof this.s.dt.oInstance.fnVersionCheck != 'function' ||
379
+ this.s.dt.oInstance.fnVersionCheck( '1.8.0' ) !== true )
380
+ {
381
+ alert( "FixedColumns "+FixedColumns.VERSION+" required DataTables 1.8.0 or later. "+
382
+ "Please upgrade your DataTables installation" );
383
+ return;
384
+ }
385
+
386
+ if ( this.s.dt.oScroll.sX === "" )
387
+ {
388
+ this.s.dt.oInstance.oApi._fnLog( this.s.dt, 1, "FixedColumns is not needed (no "+
389
+ "x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for "+
390
+ "column fixing when scrolling is not enabled" );
391
+ return;
392
+ }
393
+
394
+ /* Apply the settings from the user / defaults */
395
+ this.s = $.extend( true, this.s, FixedColumns.defaults, oInit );
396
+
397
+ /* Set up the DOM as we need it and cache nodes */
398
+ this.dom.grid.dt = $(this.s.dt.nTable).parents('div.dataTables_scroll')[0];
399
+ this.dom.scroller = $('div.dataTables_scrollBody', this.dom.grid.dt )[0];
400
+
401
+ var iScrollWidth = $(this.dom.grid.dt).width();
402
+ var iLeftWidth = 0;
403
+ var iRightWidth = 0;
404
+
405
+ $('tbody>tr:eq(0)>td, tbody>tr:eq(0)>th', this.s.dt.nTable).each( function (i) {
406
+ // Inner width is used to assign widths to cells
407
+ that.s.aiInnerWidths.push( $(this).width() );
408
+
409
+ // Outer width is used to calculate the container
410
+ iWidth = $(this).outerWidth();
411
+ that.s.aiOuterWidths.push( iWidth );
412
+
413
+ if ( i < that.s.iLeftColumns )
414
+ {
415
+ iLeftWidth += iWidth;
416
+ }
417
+ if ( that.s.iTableColumns-that.s.iRightColumns <= i )
418
+ {
419
+ iRightWidth += iWidth;
420
+ }
421
+ } );
422
+
423
+ if ( this.s.iLeftWidth === null )
424
+ {
425
+ this.s.iLeftWidth = this.s.sLeftWidth == 'fixed' ?
426
+ iLeftWidth : (iLeftWidth/iScrollWidth) * 100;
427
+ }
428
+
429
+ if ( this.s.iRightWidth === null )
430
+ {
431
+ this.s.iRightWidth = this.s.sRightWidth == 'fixed' ?
432
+ iRightWidth : (iRightWidth/iScrollWidth) * 100;
433
+ }
434
+
435
+ /* Set up the DOM that we want for the fixed column layout grid */
436
+ this._fnGridSetup();
437
+
438
+ /* Use the DataTables API method fnSetColumnVis to hide the columns we are going to fix */
439
+ for ( i=0 ; i<this.s.iLeftColumns ; i++ )
440
+ {
441
+ this.s.dt.oInstance.fnSetColumnVis( i, false );
442
+ }
443
+ for ( i=this.s.iTableColumns - this.s.iRightColumns ; i<this.s.iTableColumns ; i++ )
444
+ {
445
+ this.s.dt.oInstance.fnSetColumnVis( i, false );
446
+ }
447
+
448
+ /* Event handlers */
449
+ $(this.dom.scroller).scroll( function () {
450
+ that.dom.grid.left.body.scrollTop = that.dom.scroller.scrollTop;
451
+ if ( that.s.iRightColumns > 0 )
452
+ {
453
+ that.dom.grid.right.body.scrollTop = that.dom.scroller.scrollTop;
454
+ }
455
+ } );
456
+
457
+ $(window).resize( function () {
458
+ that._fnGridLayout.call( that );
459
+ } );
460
+
461
+ var bFirstDraw = true;
462
+ this.s.dt.aoDrawCallback = [ {
463
+ "fn": function () {
464
+ that._fnDraw.call( that, bFirstDraw );
465
+ that._fnGridHeight( that );
466
+ bFirstDraw = false;
467
+ },
468
+ "sName": "FixedColumns"
469
+ } ].concat( this.s.dt.aoDrawCallback );
470
+
471
+ /* Get things right to start with - note that due to adjusting the columns, there must be
472
+ * another redraw of the main table. It doesn't need to be a full redraw however.
473
+ */
474
+ this._fnGridLayout();
475
+ this._fnGridHeight();
476
+ this.s.dt.oInstance.fnDraw(false);
477
+ },
478
+
479
+
480
+ /**
481
+ * Set up the DOM for the fixed column. The way the layout works is to create a 1x3 grid
482
+ * for the left column, the DataTable (for which we just reuse the scrolling element DataTable
483
+ * puts into the DOM) and the right column. In each of he two fixed column elements there is a
484
+ * grouping wrapper element and then a head, body and footer wrapper. In each of these we then
485
+ * place the cloned header, body or footer tables. This effectively gives as 3x3 grid structure.
486
+ * @returns {void}
487
+ * @private
488
+ */
489
+ "_fnGridSetup": function ()
490
+ {
491
+ var that = this;
492
+
493
+ this.dom.body = this.s.dt.nTable;
494
+ this.dom.header = this.s.dt.nTHead.parentNode;
495
+ this.dom.header.parentNode.parentNode.style.position = "relative";
496
+
497
+ var nSWrapper =
498
+ $('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;">'+
499
+ '<div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;">'+
500
+ '<div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
501
+ '<div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
502
+ '<div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
503
+ '</div>'+
504
+ '<div class="DTFC_RightWrapper" style="position:absolute; top:0; left:0;">'+
505
+ '<div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
506
+ '<div class="DTFC_RightBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
507
+ '<div class="DTFC_RightFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div>'+
508
+ '</div>'+
509
+ '</div>')[0];
510
+ nLeft = nSWrapper.childNodes[0];
511
+ nRight = nSWrapper.childNodes[1];
512
+
513
+ this.dom.grid.wrapper = nSWrapper;
514
+ this.dom.grid.left.wrapper = nLeft;
515
+ this.dom.grid.left.head = nLeft.childNodes[0];
516
+ this.dom.grid.left.body = nLeft.childNodes[1];
517
+
518
+ if ( this.s.iRightColumns > 0 )
519
+ {
520
+ this.dom.grid.right.wrapper = nRight;
521
+ this.dom.grid.right.head = nRight.childNodes[0];
522
+ this.dom.grid.right.body = nRight.childNodes[1];
523
+ }
524
+
525
+ if ( this.s.dt.nTFoot )
526
+ {
527
+ this.dom.footer = this.s.dt.nTFoot.parentNode;
528
+ this.dom.grid.left.foot = nLeft.childNodes[2];
529
+ if ( this.s.iRightColumns > 0 )
530
+ {
531
+ this.dom.grid.right.foot = nRight.childNodes[2];
532
+ }
533
+ }
534
+
535
+ nSWrapper.appendChild( nLeft );
536
+ this.dom.grid.dt.parentNode.insertBefore( nSWrapper, this.dom.grid.dt );
537
+ nSWrapper.appendChild( this.dom.grid.dt );
538
+
539
+ this.dom.grid.dt.style.position = "absolute";
540
+ this.dom.grid.dt.style.top = "0px";
541
+ this.dom.grid.dt.style.left = this.s.iLeftWidth+"px";
542
+ this.dom.grid.dt.style.width = ($(this.dom.grid.dt).width()-this.s.iLeftWidth-this.s.iRightWidth)+"px";
543
+ },
544
+
545
+
546
+ /**
547
+ * Style and position the grid used for the FixedColumns layout based on the instance settings.
548
+ * Specifically sLeftWidth ('fixed' or 'absolute'), iLeftWidth (px if fixed, % if absolute) and
549
+ * there 'right' counterparts.
550
+ * @returns {void}
551
+ * @private
552
+ */
553
+ "_fnGridLayout": function ()
554
+ {
555
+ var oGrid = this.dom.grid;
556
+ var iTotal = $(oGrid.wrapper).width();
557
+ var iLeft = 0, iRight = 0, iRemainder = 0;
558
+
559
+ if ( this.s.sLeftWidth == 'fixed' )
560
+ {
561
+ iLeft = this.s.iLeftWidth;
562
+ }
563
+ else
564
+ {
565
+ iLeft = ( this.s.iLeftWidth / 100 ) * iTotal;
566
+ }
567
+
568
+ if ( this.s.sRightWidth == 'fixed' )
569
+ {
570
+ iRight = this.s.iRightWidth;
571
+ }
572
+ else
573
+ {
574
+ iRight = ( this.s.iRightWidth / 100 ) * iTotal;
575
+ }
576
+
577
+ iRemainder = iTotal - iLeft - iRight;
578
+
579
+ oGrid.left.wrapper.style.width = iLeft+"px";
580
+ oGrid.dt.style.width = iRemainder+"px";
581
+ oGrid.dt.style.left = iLeft+"px";
582
+
583
+ if ( this.s.iRightColumns > 0 )
584
+ {
585
+ oGrid.right.wrapper.style.width = iRight+"px";
586
+ oGrid.right.wrapper.style.left = (iTotal-iRight)+"px";
587
+ }
588
+ },
589
+
590
+
591
+ /**
592
+ * Recalculate and set the height of the grid components used for positioning of the
593
+ * FixedColumn display grid.
594
+ * @returns {void}
595
+ * @private
596
+ */
597
+ "_fnGridHeight": function ()
598
+ {
599
+ var oGrid = this.dom.grid;
600
+ var iHeight = $(this.dom.grid.dt).height();
601
+
602
+ oGrid.wrapper.style.height = iHeight+"px";
603
+ oGrid.left.body.style.height = $(this.dom.scroller).height()+"px";
604
+ oGrid.left.wrapper.style.height = iHeight+"px";
605
+
606
+ if ( this.s.iRightColumns > 0 )
607
+ {
608
+ oGrid.right.wrapper.style.height = iHeight+"px";
609
+ oGrid.right.body.style.height = $(this.dom.scroller).height()+"px";
610
+ }
611
+ },
612
+
613
+
614
+ /**
615
+ * Clone and position the fixed columns
616
+ * @returns {void}
617
+ * @param {Boolean} bAll Indicate if the header and footer should be updated as well (true)
618
+ * @private
619
+ */
620
+ "_fnDraw": function ( bAll )
621
+ {
622
+ this._fnCloneLeft( bAll );
623
+ this._fnCloneRight( bAll );
624
+
625
+ /* Draw callback function */
626
+ if ( this.s.fnDrawCallback !== null )
627
+ {
628
+ this.s.fnDrawCallback.call( this, this.dom.clone.left, this.dom.clone.right );
629
+ }
630
+
631
+ /* Event triggering */
632
+ $(this).trigger( 'draw', {
633
+ "leftClone": this.dom.clone.left,
634
+ "rightClone": this.dom.clone.right
635
+ } );
636
+ },
637
+
638
+
639
+ /**
640
+ * Clone the right columns
641
+ * @returns {void}
642
+ * @param {Boolean} bAll Indicate if the header and footer should be updated as well (true)
643
+ * @private
644
+ */
645
+ "_fnCloneRight": function ( bAll )
646
+ {
647
+ if ( this.s.iRightColumns <= 0 )
648
+ {
649
+ return;
650
+ }
651
+
652
+ var that = this,
653
+ i, jq,
654
+ aiColumns = [];
655
+
656
+ for ( i=this.s.iTableColumns-this.s.iRightColumns ; i<this.s.iTableColumns ; i++ )
657
+ {
658
+ aiColumns.push( i );
659
+ }
660
+
661
+ this._fnClone( this.dom.clone.right, this.dom.grid.right, aiColumns, bAll );
662
+ },
663
+
664
+
665
+ /**
666
+ * Clone the left columns
667
+ * @returns {void}
668
+ * @param {Boolean} bAll Indicate if the header and footer should be updated as well (true)
669
+ * @private
670
+ */
671
+ "_fnCloneLeft": function ( bAll )
672
+ {
673
+ if ( this.s.iLeftColumns <= 0 )
674
+ {
675
+ return;
676
+ }
677
+
678
+ var that = this,
679
+ i, jq,
680
+ aiColumns = [];
681
+
682
+ for ( i=0 ; i<this.s.iLeftColumns ; i++ )
683
+ {
684
+ aiColumns.push( i );
685
+ }
686
+
687
+ this._fnClone( this.dom.clone.left, this.dom.grid.left, aiColumns, bAll );
688
+ },
689
+
690
+
691
+ /**
692
+ * Make a copy of the layout object for a header or footer element from DataTables. Note that
693
+ * this method will clone the nodes in the layout object.
694
+ * @returns {Array} Copy of the layout array
695
+ * @param {Object} aoOriginal Layout array from DataTables (aoHeader or aoFooter)
696
+ * @param {Object} aiColumns Columns to copy
697
+ * @private
698
+ */
699
+ "_fnCopyLayout": function ( aoOriginal, aiColumns )
700
+ {
701
+ var aReturn = [];
702
+ var aClones = [];
703
+ var aCloned = [];
704
+
705
+ for ( var i=0, iLen=aoOriginal.length ; i<iLen ; i++ )
706
+ {
707
+ var aRow = [];
708
+ aRow.nTr = $(aoOriginal[i].nTr).clone(true)[0];
709
+
710
+ for ( var j=0, jLen=this.s.iTableColumns ; j<jLen ; j++ )
711
+ {
712
+ if ( $.inArray( j, aiColumns ) === -1 )
713
+ {
714
+ continue;
715
+ }
716
+
717
+ var iCloned = $.inArray( aoOriginal[i][j].cell, aCloned );
718
+ if ( iCloned === -1 )
719
+ {
720
+ var nClone = $(aoOriginal[i][j].cell).clone(true)[0];
721
+ aClones.push( nClone );
722
+ aCloned.push( aoOriginal[i][j].cell );
723
+
724
+ aRow.push( {
725
+ "cell": nClone,
726
+ "unique": aoOriginal[i][j].unique
727
+ } );
728
+ }
729
+ else
730
+ {
731
+ aRow.push( {
732
+ "cell": aClones[ iCloned ],
733
+ "unique": aoOriginal[i][j].unique
734
+ } );
735
+ }
736
+ }
737
+
738
+ aReturn.push( aRow );
739
+ }
740
+
741
+ return aReturn;
742
+ },
743
+
744
+
745
+ /**
746
+ * Clone the DataTable nodes and place them in the DOM (sized correctly)
747
+ * @returns {void}
748
+ * @param {Object} oClone Object containing the header, footer and body cloned DOM elements
749
+ * @param {Object} oGrid Grid object containing the display grid elements for the cloned
750
+ * column (left or right)
751
+ * @param {Array} aiColumns Column indexes which should be operated on from the DataTable
752
+ * @param {Boolean} bAll Indicate if the header and footer should be updated as well (true)
753
+ * @private
754
+ */
755
+ "_fnClone": function ( oClone, oGrid, aiColumns, bAll )
756
+ {
757
+ var that = this,
758
+ i, iLen, j, jLen, jq, nTarget, iColumn, nClone, iIndex;
759
+
760
+ /*
761
+ * Header
762
+ */
763
+ if ( bAll )
764
+ {
765
+ if ( oClone.header !== null )
766
+ {
767
+ oClone.header.parentNode.removeChild( oClone.header );
768
+ }
769
+ oClone.header = $(this.dom.header).clone(true)[0];
770
+ oClone.header.className += " DTFC_Cloned";
771
+ oClone.header.style.width = "100%";
772
+ oGrid.head.appendChild( oClone.header );
773
+
774
+ /* Copy the DataTables layout cache for the header for our floating column */
775
+ var aoCloneLayout = this._fnCopyLayout( this.s.dt.aoHeader, aiColumns );
776
+ var jqCloneThead = $('>thead', oClone.header);
777
+ jqCloneThead.empty();
778
+
779
+ /* Add the created cloned TR elements to the table */
780
+ for ( i=0, iLen=aoCloneLayout.length ; i<iLen ; i++ )
781
+ {
782
+ jqCloneThead[0].appendChild( aoCloneLayout[i].nTr );
783
+ }
784
+
785
+ /* Use the handy _fnDrawHead function in DataTables to do the rowspan/colspan
786
+ * calculations for us
787
+ */
788
+ this.s.dt.oApi._fnDrawHead( this.s.dt, aoCloneLayout, true );
789
+ }
790
+ else
791
+ {
792
+ /* To ensure that we copy cell classes exactly, regardless of colspan, multiple rows
793
+ * etc, we make a copy of the header from the DataTable again, but don't insert the
794
+ * cloned cells, just copy the classes across. To get the matching layout for the
795
+ * fixed component, we use the DataTables _fnDetectHeader method, allowing 1:1 mapping
796
+ */
797
+ var aoCloneLayout = this._fnCopyLayout( this.s.dt.aoHeader, aiColumns );
798
+ var aoFixedHeader=[];
799
+
800
+ this.s.dt.oApi._fnDetectHeader( aoFixedHeader, $('>thead', oClone.header)[0] );
801
+
802
+ for ( i=0, iLen=aoCloneLayout.length ; i<iLen ; i++ )
803
+ {
804
+ for ( j=0, jLen=aoCloneLayout[i].length ; j<jLen ; j++ )
805
+ {
806
+ aoFixedHeader[i][j].cell.className = aoCloneLayout[i][j].cell.className;
807
+
808
+ // If jQuery UI theming is used we need to copy those elements as well
809
+ $('span.DataTables_sort_icon', aoFixedHeader[i][j].cell).each( function () {
810
+ this.className = $('span.DataTables_sort_icon', aoCloneLayout[i][j].cell)[0].className;
811
+ } );
812
+ }
813
+ }
814
+ }
815
+ this._fnEqualiseHeights( 'thead', this.dom.header, oClone.header );
816
+
817
+ /*
818
+ * Body
819
+ */
820
+ if ( this.s.sHeightMatch == 'auto' )
821
+ {
822
+ /* Remove any heights which have been applied already and let the browser figure it out */
823
+ $('>tbody>tr', that.dom.body).css('height', 'auto');
824
+ }
825
+
826
+ if ( oClone.body !== null )
827
+ {
828
+ oClone.body.parentNode.removeChild( oClone.body );
829
+ oClone.body = null;
830
+ }
831
+
832
+ oClone.body = $(this.dom.body).clone(true)[0];
833
+ oClone.body.className += " DTFC_Cloned";
834
+ oClone.body.style.paddingBottom = this.s.dt.oScroll.iBarWidth+"px";
835
+ oClone.body.style.marginBottom = (this.s.dt.oScroll.iBarWidth*2)+"px"; /* For IE */
836
+ if ( oClone.body.getAttribute('id') !== null )
837
+ {
838
+ oClone.body.removeAttribute('id');
839
+ }
840
+
841
+ $('>thead>tr', oClone.body).empty();
842
+ $('>tfoot', oClone.body).remove();
843
+
844
+ var nBody = $('tbody', oClone.body)[0];
845
+ $(nBody).empty();
846
+ if ( this.s.dt.aiDisplay.length > 0 )
847
+ {
848
+ /* Copy the DataTables' header elements to force the column width in exactly the
849
+ * same way that DataTables does it - have the header element, apply the width and
850
+ * colapse it down
851
+ */
852
+ var nInnerThead = $('>thead>tr', oClone.body)[0];
853
+ for ( iIndex=0 ; iIndex<aiColumns.length ; iIndex++ )
854
+ {
855
+ iColumn = aiColumns[iIndex];
856
+
857
+ nClone = $(this.s.dt.aoColumns[iColumn].nTh).clone(true)[0];
858
+ nClone.innerHTML = "";
859
+
860
+ oStyle = nClone.style;
861
+ oStyle.paddingTop = "0";
862
+ oStyle.paddingBottom = "0";
863
+ oStyle.borderTopWidth = "0";
864
+ oStyle.borderBottomWidth = "0";
865
+ oStyle.height = 0;
866
+ oStyle.width = that.s.aiInnerWidths[iColumn]+"px";
867
+
868
+ nInnerThead.appendChild( nClone );
869
+ }
870
+
871
+ /* Add in the tbody elements, cloning form the master table */
872
+ $('>tbody>tr', that.dom.body).each( function (z) {
873
+ var n = this.cloneNode(false);
874
+ var i = that.s.dt.oFeatures.bServerSide===false ?
875
+ that.s.dt.aiDisplay[ that.s.dt._iDisplayStart+z ] : z;
876
+ for ( iIndex=0 ; iIndex<aiColumns.length ; iIndex++ )
877
+ {
878
+ iColumn = aiColumns[iIndex];
879
+ if ( typeof that.s.dt.aoData[i]._anHidden[iColumn] != 'undefined' )
880
+ {
881
+ nClone = $(that.s.dt.aoData[i]._anHidden[iColumn]).clone(true)[0];
882
+ n.appendChild( nClone );
883
+ }
884
+ }
885
+ nBody.appendChild( n );
886
+ } );
887
+ }
888
+ else
889
+ {
890
+ $('>tbody>tr', that.dom.body).each( function (z) {
891
+ nClone = this.cloneNode(true);
892
+ nClone.className += ' DTFC_NoData';
893
+ $('td', nClone).html('');
894
+ nBody.appendChild( nClone );
895
+ } );
896
+ }
897
+
898
+ oClone.body.style.width = "100%";
899
+ oGrid.body.appendChild( oClone.body );
900
+
901
+ this._fnEqualiseHeights( 'tbody', that.dom.body, oClone.body );
902
+
903
+ /*
904
+ * Footer
905
+ */
906
+ if ( this.s.dt.nTFoot !== null )
907
+ {
908
+ if ( bAll )
909
+ {
910
+ if ( oClone.footer !== null )
911
+ {
912
+ oClone.footer.parentNode.removeChild( oClone.footer );
913
+ }
914
+ oClone.footer = $(this.dom.footer).clone(true)[0];
915
+ oClone.footer.className += " DTFC_Cloned";
916
+ oClone.footer.style.width = "100%";
917
+ oGrid.foot.appendChild( oClone.footer );
918
+
919
+ /* Copy the footer just like we do for the header */
920
+ var aoCloneLayout = this._fnCopyLayout( this.s.dt.aoFooter, aiColumns );
921
+ var jqCloneTfoot = $('>tfoot', oClone.footer);
922
+ jqCloneTfoot.empty();
923
+
924
+ for ( i=0, iLen=aoCloneLayout.length ; i<iLen ; i++ )
925
+ {
926
+ jqCloneTfoot[0].appendChild( aoCloneLayout[i].nTr );
927
+ }
928
+ this.s.dt.oApi._fnDrawHead( this.s.dt, aoCloneLayout, true );
929
+ }
930
+ else
931
+ {
932
+ var aoCloneLayout = this._fnCopyLayout( this.s.dt.aoFooter, aiColumns );
933
+ var aoCurrFooter=[];
934
+
935
+ this.s.dt.oApi._fnDetectHeader( aoCurrFooter, $('>tfoot', oClone.footer)[0] );
936
+
937
+ for ( i=0, iLen=aoCloneLayout.length ; i<iLen ; i++ )
938
+ {
939
+ for ( j=0, jLen=aoCloneLayout[i].length ; j<jLen ; j++ )
940
+ {
941
+ aoCurrFooter[i][j].cell.className = aoCloneLayout[i][j].cell.className;
942
+ }
943
+ }
944
+ }
945
+ this._fnEqualiseHeights( 'tfoot', this.dom.footer, oClone.footer );
946
+ }
947
+
948
+ /* Equalise the column widths between the header footer and body - body get's priority */
949
+ var anUnique = this.s.dt.oApi._fnGetUniqueThs( this.s.dt, $('>thead', oClone.header)[0] );
950
+ $(anUnique).each( function (i) {
951
+ iColumn = aiColumns[i];
952
+ this.style.width = that.s.aiInnerWidths[iColumn]+"px";
953
+ } );
954
+
955
+ if ( that.s.dt.nTFoot !== null )
956
+ {
957
+ anUnique = this.s.dt.oApi._fnGetUniqueThs( this.s.dt, $('>tfoot', oClone.footer)[0] );
958
+ $(anUnique).each( function (i) {
959
+ iColumn = aiColumns[i];
960
+ this.style.width = that.s.aiInnerWidths[iColumn]+"px";
961
+ } );
962
+ }
963
+ },
964
+
965
+
966
+ /**
967
+ * From a given table node (THEAD etc), get a list of TR direct child elements
968
+ * @param {Node} nIn Table element to search for TR elements (THEAD, TBODY or TFOOT element)
969
+ * @returns {Array} List of TR elements found
970
+ * @private
971
+ */
972
+ "_fnGetTrNodes": function ( nIn )
973
+ {
974
+ var aOut = [];
975
+ for ( var i=0, iLen=nIn.childNodes.length ; i<iLen ; i++ )
976
+ {
977
+ if ( nIn.childNodes[i].nodeName.toUpperCase() == "TR" )
978
+ {
979
+ aOut.push( nIn.childNodes[i] );
980
+ }
981
+ }
982
+ return aOut;
983
+ },
984
+
985
+
986
+ /**
987
+ * Equalise the heights of the rows in a given table node in a cross browser way
988
+ * @returns {void}
989
+ * @param {String} nodeName Node type - thead, tbody or tfoot
990
+ * @param {Node} original Original node to take the heights from
991
+ * @param {Node} clone Copy the heights to
992
+ * @private
993
+ */
994
+ "_fnEqualiseHeights": function ( nodeName, original, clone )
995
+ {
996
+ if ( this.s.sHeightMatch == 'none' && nodeName !== 'thead' && nodeName !== 'tfoot' )
997
+ {
998
+ return;
999
+ }
1000
+
1001
+ var that = this,
1002
+ i, iLen, iHeight, iHeight2, iHeightOriginal, iHeightClone,
1003
+ rootOriginal = original.getElementsByTagName(nodeName)[0],
1004
+ rootClone = clone.getElementsByTagName(nodeName)[0],
1005
+ jqBoxHack = $('>'+nodeName+'>tr:eq(0)', original).children(':first'),
1006
+ iBoxHack = jqBoxHack.outerHeight() - jqBoxHack.height(),
1007
+ anOriginal = this._fnGetTrNodes( rootOriginal ),
1008
+ anClone = this._fnGetTrNodes( rootClone );
1009
+
1010
+ for ( i=0, iLen=anClone.length ; i<iLen ; i++ )
1011
+ {
1012
+ if ( this.s.sHeightMatch == 'semiauto' && typeof anOriginal[i]._DTTC_iHeight != 'undefined' &&
1013
+ anOriginal[i]._DTTC_iHeight !== null )
1014
+ {
1015
+ /* Oddly enough, IE / Chrome seem not to copy the style height - Mozilla and Opera keep it */
1016
+ if ( $.browser.msie )
1017
+ {
1018
+ $(anClone[i]).children().height( anOriginal[i]._DTTC_iHeight-iBoxHack );
1019
+ }
1020
+ continue;
1021
+ }
1022
+
1023
+ iHeightOriginal = anOriginal[i].offsetHeight;
1024
+ iHeightClone = anClone[i].offsetHeight;
1025
+ iHeight = iHeightClone > iHeightOriginal ? iHeightClone : iHeightOriginal;
1026
+
1027
+ if ( this.s.sHeightMatch == 'semiauto' )
1028
+ {
1029
+ anOriginal[i]._DTTC_iHeight = iHeight;
1030
+ }
1031
+
1032
+ /* Can we use some kind of object detection here?! This is very nasty - damn browsers */
1033
+ if ( $.browser.msie && $.browser.version < 8 )
1034
+ {
1035
+ $(anClone[i]).children().height( iHeight-iBoxHack );
1036
+ $(anOriginal[i]).children().height( iHeight-iBoxHack );
1037
+ }
1038
+ else
1039
+ {
1040
+ anClone[i].style.height = iHeight+"px";
1041
+ anOriginal[i].style.height = iHeight+"px";
1042
+ }
1043
+ }
1044
+ }
1045
+ };
1046
+
1047
+
1048
+
1049
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1050
+ * Statics
1051
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1052
+
1053
+
1054
+ /**
1055
+ * FixedColumns default settings for initialisation
1056
+ * @namespace
1057
+ * @static
1058
+ */
1059
+ FixedColumns.defaults = {
1060
+ /**
1061
+ * Number of left hand columns to fix in position
1062
+ * @type int
1063
+ * @default 1
1064
+ * @static
1065
+ * @example
1066
+ * var oTable = $('#example').dataTable( {
1067
+ * "sScrollX": "100%"
1068
+ * } );
1069
+ * new FixedColumns( oTable, {
1070
+ * "iLeftColumns": 2
1071
+ * } );
1072
+ */
1073
+ "iLeftColumns": 1,
1074
+
1075
+ /**
1076
+ * Number of right hand columns to fix in position
1077
+ * @type int
1078
+ * @default 0
1079
+ * @static
1080
+ * @example
1081
+ * var oTable = $('#example').dataTable( {
1082
+ * "sScrollX": "100%"
1083
+ * } );
1084
+ * new FixedColumns( oTable, {
1085
+ * "iRightColumns": 1
1086
+ * } );
1087
+ */
1088
+ "iRightColumns": 0,
1089
+
1090
+ /**
1091
+ * Draw callback function which is called when FixedColumns has redrawn the fixed assets
1092
+ * @type function(object, object):void
1093
+ * @default null
1094
+ * @static
1095
+ * @example
1096
+ * var oTable = $('#example').dataTable( {
1097
+ * "sScrollX": "100%"
1098
+ * } );
1099
+ * new FixedColumns( oTable, {
1100
+ * "fnDrawCallback": function () {
1101
+ * alert( "FixedColumns redraw" );
1102
+ * }
1103
+ * } );
1104
+ */
1105
+ "fnDrawCallback": null,
1106
+
1107
+ /**
1108
+ * Type of left column size calculation. Can take the values of "fixed", whereby the iLeftWidth
1109
+ * value will be treated as a pixel value, or "relative" for which case iLeftWidth will be
1110
+ * treated as a percentage value.
1111
+ * @type string
1112
+ * @default fixed
1113
+ * @static
1114
+ * @example
1115
+ * var oTable = $('#example').dataTable( {
1116
+ * "sScrollX": "100%"
1117
+ * } );
1118
+ * new FixedColumns( oTable, {
1119
+ * "sLeftWidth": "relative",
1120
+ * "iLeftWidth": 10 // percentage
1121
+ * } );
1122
+ */
1123
+ "sLeftWidth": "fixed",
1124
+
1125
+ /**
1126
+ * Width to set for the width of the left fixed column(s) - note that the behaviour of this
1127
+ * property is directly effected by the sLeftWidth property. If not defined then this property
1128
+ * is calculated automatically from what has been assigned by DataTables.
1129
+ * @type int
1130
+ * @default null
1131
+ * @static
1132
+ * @example
1133
+ * var oTable = $('#example').dataTable( {
1134
+ * "sScrollX": "100%"
1135
+ * } );
1136
+ * new FixedColumns( oTable, {
1137
+ * "iLeftWidth": 100 // pixels
1138
+ * } );
1139
+ */
1140
+ "iLeftWidth": null,
1141
+
1142
+ /**
1143
+ * Type of right column size calculation. Can take the values of "fixed", whereby the
1144
+ * iRightWidth value will be treated as a pixel value, or "relative" for which case
1145
+ * iRightWidth will be treated as a percentage value.
1146
+ * @type string
1147
+ * @default fixed
1148
+ * @static
1149
+ * @example
1150
+ * var oTable = $('#example').dataTable( {
1151
+ * "sScrollX": "100%"
1152
+ * } );
1153
+ * new FixedColumns( oTable, {
1154
+ * "sRightWidth": "relative",
1155
+ * "iRightWidth": 10 // percentage
1156
+ * } );
1157
+ */
1158
+ "sRightWidth": "fixed",
1159
+
1160
+ /**
1161
+ * Width to set for the width of the right fixed column(s) - note that the behaviour of this
1162
+ * property is directly effected by the sRightWidth property. If not defined then this property
1163
+ * is calculated automatically from what has been assigned by DataTables.
1164
+ * @type int
1165
+ * @default null
1166
+ * @static
1167
+ * @example
1168
+ * var oTable = $('#example').dataTable( {
1169
+ * "sScrollX": "100%"
1170
+ * } );
1171
+ * new FixedColumns( oTable, {
1172
+ * "iRightWidth": 200 // pixels
1173
+ * } );
1174
+ */
1175
+ "iRightWidth": null,
1176
+
1177
+ /**
1178
+ * Height matching algorthim to use. This can be "none" which will result in no height
1179
+ * matching being applied by FixedColumns (height matching could be forced by CSS in this
1180
+ * case), "semiauto" whereby the height calculation will be performed once, and the result
1181
+ * cached to be used again (fnRecalculateHeight can be used to force recalculation), or
1182
+ * "auto" when height matching is performed on every draw (slowest but must accurate)
1183
+ * @type string
1184
+ * @default semiauto
1185
+ * @static
1186
+ * @example
1187
+ * var oTable = $('#example').dataTable( {
1188
+ * "sScrollX": "100%"
1189
+ * } );
1190
+ * new FixedColumns( oTable, {
1191
+ * "sHeightMatch": "auto"
1192
+ * } );
1193
+ */
1194
+ "sHeightMatch": "semiauto"
1195
+ };
1196
+
1197
+
1198
+
1199
+
1200
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1201
+ * Constants
1202
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1203
+
1204
+
1205
+ /**
1206
+ * Name of this class
1207
+ * @constant CLASS
1208
+ * @type String
1209
+ * @default FixedColumns
1210
+ */
1211
+ FixedColumns.prototype.CLASS = "FixedColumns";
1212
+
1213
+
1214
+ /**
1215
+ * FixedColumns version
1216
+ * @constant FixedColumns.VERSION
1217
+ * @type String
1218
+ * @default See code
1219
+ * @static
1220
+ */
1221
+ FixedColumns.VERSION = "2.0.4.dev";
1222
+
1223
+
1224
+
1225
+ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
1226
+ * Fired events (for documentation)
1227
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1228
+
1229
+
1230
+ /**
1231
+ * Event fired whenever FixedColumns redraws the fixed columns (i.e. clones the table elements from the main DataTable). This will occur whenever the DataTable that the FixedColumns instance is attached does its own draw.
1232
+ * @name FixedColumns#draw
1233
+ * @event
1234
+ * @param {event} e jQuery event object
1235
+ * @param {object} o Event parameters from FixedColumns
1236
+ * @param {object} o.leftClone Instance's object dom.clone.left for easy reference. This object contains references to the left fixed clumn column's nodes
1237
+ * @param {object} o.rightClone Instance's object dom.clone.right for easy reference. This object contains references to the right fixed clumn column's nodes
1238
+ */
1239
+
1240
+ })(jQuery, window, document);