Debian Codegraph @

js/widgets/widget-columnSelector.js

raw symbols SCIP
1 /* Widget: columnSelector (responsive table widget) - updated 2018-08-03 (v2.31.2) *//*
2 * Requires tablesorter v2.8+ and jQuery 1.7+
3 * by Justin Hallett & Rob Garrison
4 */
5 /*jshint browser:true, jquery:true, unused:false */
6 /*global jQuery: false */
7 ;(function($) {
8 'use strict';
9
10 var ts = $.tablesorter,
11 namespace = '.tscolsel',
12 tsColSel = ts.columnSelector = {
13
14 queryAll : '@media only all { [columns] { display: none; } } ',
15 queryBreak : '@media all and (min-width: [size]) { [columns] { display: table-cell; } } ',
16
17 init: function(table, c, wo) {
18 var $t, colSel,
19 debug = ts.debug(c, 'columnSelector');
20
21 // abort if no input is contained within the layout
22 $t = $(wo.columnSelector_layout);
23 if (!$t.find('input').add( $t.filter('input') ).length) {
24 if (debug) {
25 console.error('ColumnSelector >> ERROR: Column Selector aborting, no input found in the layout! ***');
26 }
27 return;
28 }
29
30 // unique table class name
31 c.$table.addClass( c.namespace.slice(1) + 'columnselector' );
32
33 // build column selector/state array
34 colSel = c.selector = { $container : $(wo.columnSelector_container || '<div>') };
35 colSel.$style = $('<style></style>').prop('disabled', true).appendTo('head');
36 colSel.$breakpoints = $('<style></style>').prop('disabled', true).appendTo('head');
37
38 colSel.isInitializing = true;
39 tsColSel.setUpColspan(c, wo);
40 tsColSel.setupSelector(c, wo);
41
42 if (wo.columnSelector_mediaquery) {
43 tsColSel.setupBreakpoints(c, wo);
44 }
45
46 colSel.isInitializing = false;
47 if (colSel.$container.length) {
48 tsColSel.updateCols(c, wo);
49 } else if (debug) {
50 console.warn('ColumnSelector >> container not found');
51 }
52
53 c.$table
54 .off('refreshColumnSelector' + namespace)
55 /* $('table').trigger('refreshColumnSelector', arguments ); showing arguments below
56 undefined = refresh current settings (update css hiding columns)
57 'selectors' = update container contents (replace inputs/labels)
58 [ [2,3,4] ] = set visible columns; turn off "auto" mode.
59 [ 'columns', [2,3,4] ] = set visible columns; turn off "auto" mode.
60 [ 'auto', [2,3,4] ] = set visible columns; turn on "auto" mode.
61 true = turn on "auto" mode.
62 */
63 .on('refreshColumnSelector' + namespace, function( e, optName, optState ) {
64 // make sure we're using current config settings
65 tsColSel.refreshColumns( this.config, optName, optState );
66 });
67
68 if (debug) {
69 console.log('ColumnSelector >> Widget initialized');
70 }
71 },
72
73 refreshColumns: function( c, optName, optState ) {
74 var i, arry, $el, val,
75 colSel = c.selector,
76 isArry = $.isArray(optState || optName),
77 wo = c.widgetOptions;
78 // see #798
79 if (typeof optName !== 'undefined' && optName !== null && colSel.$container.length) {
80 // pass "selectors" to update the all of the container contents
81 if ( optName === 'selectors' ) {
82 colSel.$container.empty();
83 tsColSel.setupSelector(c, wo);
84 tsColSel.setupBreakpoints(c, wo);
85 // if optState is undefined, maintain the current "auto" state
86 if ( typeof optState === 'undefined' && optState !== null ) {
87 optState = colSel.auto;
88 }
89 }
90 // pass an array of column zero-based indexes to turn off auto mode & toggle selected columns
91 if (isArry) {
92 arry = optState || optName;
93 // make sure array contains numbers
94 $.each(arry, function(i, v) {
95 arry[i] = parseInt(v, 10);
96 });
97 for (i = 0; i < c.columns; i++) {
98 val = $.inArray( i, arry ) >= 0;
99 $el = colSel.$container.find( 'input[data-column=' + i + ']' );
100 if ( $el.length ) {
101 $el.prop( 'checked', val );
102 colSel.states[i] = val;
103 }
104 }
105 }
106 // if passing an array, set auto to false to allow manual column selection & update columns
107 // refreshColumns( c, 'auto', true ) === refreshColumns( c, true );
108 val = optState === true || optName === true || optName === 'auto' && optState !== false;
109 $el = colSel.$container.find( 'input[data-column="auto"]' ).prop( 'checked', val );
110 tsColSel.updateAuto( c, wo, $el );
111 } else {
112 tsColSel.updateBreakpoints(c, wo);
113 tsColSel.updateCols(c, wo);
114 }
115 tsColSel.saveValues( c, wo );
116 tsColSel.adjustColspans( c, wo );
117 },
118
119 setupSelector: function(c, wo) {
120 var index, name, $header, priority, col, colId, $el,
121 colSel = c.selector,
122 $container = colSel.$container,
123 useStorage = wo.columnSelector_saveColumns && ts.storage,
124 // get stored column states
125 saved = useStorage ? ts.storage( c.table, 'tablesorter-columnSelector' ) : [],
126 state = useStorage ? ts.storage( c.table, 'tablesorter-columnSelector-auto') : {};
127
128 // initial states
129 colSel.auto = $.isEmptyObject(state) || $.type(state.auto) !== 'boolean' ? wo.columnSelector_mediaqueryState : state.auto;
130 colSel.states = [];
131 colSel.$column = [];
132 colSel.$wrapper = [];
133 colSel.$checkbox = [];
134 // populate the selector container
135 for ( index = 0; index < c.columns; index++ ) {
136 $header = c.$headerIndexed[ index ];
137 // if no data-priority is assigned, default to 1, but don't remove it from the selector list
138 priority = $header.attr(wo.columnSelector_priority) || 1;
139 colId = $header.attr('data-column');
140 col = ts.getColumnData( c.table, c.headers, colId );
141 state = ts.getData( $header, col, 'columnSelector');
142
143 // if this column not hidable at all
144 // include getData check (includes 'columnSelector-false' class, data attribute, etc)
145 if ( isNaN(priority) && priority.length > 0 || state === 'disable' ||
146 ( wo.columnSelector_columns[colId] && wo.columnSelector_columns[colId] === 'disable') ) {
147 colSel.states[colId] = null;
148 continue; // goto next
149 }
150
151 // set default state; storage takes priority
152 colSel.states[colId] = saved && (typeof saved[colId] !== 'undefined' && saved[colId] !== null) ?
153 saved[colId] : (typeof wo.columnSelector_columns[colId] !== 'undefined' && wo.columnSelector_columns[colId] !== null) ?
154 wo.columnSelector_columns[colId] : (state === 'true' || state !== 'false');
155 colSel.$column[colId] = $(this);
156 if ($container.length) {
157 // set default col title
158 name = $header.attr(wo.columnSelector_name) || $header.text().trim();
159 if (typeof wo.columnSelector_layoutCustomizer === 'function') {
160 $el = $header.find('.' + ts.css.headerIn);
161 name = wo.columnSelector_layoutCustomizer( $el.length ? $el : $header, name, parseInt(colId, 10) );
162 }
163 colSel.$wrapper[colId] = $(wo.columnSelector_layout.replace(/\{name\}/g, name)).appendTo($container);
164 colSel.$checkbox[colId] = colSel.$wrapper[colId]
165 // input may not be wrapped within the layout template
166 .find('input').add( colSel.$wrapper[colId].filter('input') )
167 .attr('data-column', colId)
168 .toggleClass( wo.columnSelector_cssChecked, colSel.states[colId] )
169 .prop('checked', colSel.states[colId])
170 .on('change', function() {
171 if (!colSel.isInitializing) {
172 // ensure states is accurate
173 var colId = $(this).attr('data-column');
174 if (tsColSel.checkChange(c, this.checked)) {
175 // if (wo.columnSelector_maxVisible)
176 c.selector.states[colId] = this.checked;
177 tsColSel.updateCols(c, wo);
178 } else {
179 this.checked = !this.checked;
180 return false;
181 }
182 }
183 }).change();
184 }
185 }
186
187 },
188
189 checkChange: function(c, checked) {
190 var wo = c.widgetOptions,
191 max = wo.columnSelector_maxVisible,
192 min = wo.columnSelector_minVisible,
193 states = c.selector.states,
194 indx = states.length,
195 count = 0;
196 while (indx-- >= 0) {
197 if (states[indx]) {
198 count++;
199 }
200 }
201 if ((checked & max !== null && count >= max) ||
202 (!checked && min !== null && count <= min)) {
203 return false;
204 }
205 return true;
206 },
207
208 setupBreakpoints: function(c, wo) {
209 var colSel = c.selector;
210
211 // add responsive breakpoints
212 if (wo.columnSelector_mediaquery) {
213 // used by window resize function
214 colSel.lastIndex = -1;
215 tsColSel.updateBreakpoints(c, wo);
216 c.$table
217 .off('updateAll' + namespace)
218 .on('updateAll' + namespace, function() {
219 tsColSel.setupSelector(c, wo);
220 tsColSel.setupBreakpoints(c, wo);
221 tsColSel.updateBreakpoints(c, wo);
222 tsColSel.updateCols(c, wo);
223 });
224 }
225
226 if (colSel.$container.length) {
227 // Add media queries toggle
228 if (wo.columnSelector_mediaquery) {
229 colSel.$auto = $( wo.columnSelector_layout.replace(/\{name\}/g, wo.columnSelector_mediaqueryName) ).prependTo(colSel.$container);
230 colSel.$auto
231 // needed in case the input in the layout is not wrapped
232 .find('input').add( colSel.$auto.filter('input') )
233 .attr('data-column', 'auto')
234 .prop('checked', colSel.auto)
235 .toggleClass( wo.columnSelector_cssChecked, colSel.auto )
236 .on('change', function() {
237 tsColSel.updateAuto(c, wo, $(this));
238 }).change();
239 }
240 // Add a bind on update to re-run col setup
241 c.$table.off('update' + namespace).on('update' + namespace, function() {
242 tsColSel.updateCols(c, wo);
243 });
244 }
245 },
246
247 updateAuto: function(c, wo, $el) {
248 var colSel = c.selector;
249 colSel.auto = $el.prop('checked') || false;
250 $.each( colSel.$checkbox, function(i, $cb) {
251 if ($cb) {
252 $cb[0].disabled = colSel.auto;
253 colSel.$wrapper[i].toggleClass('disabled', colSel.auto);
254 }
255 });
256 if (wo.columnSelector_mediaquery) {
257 tsColSel.updateBreakpoints(c, wo);
258 }
259 tsColSel.updateCols(c, wo);
260 // copy the column selector to a popup/tooltip
261 if (c.selector.$popup) {
262 c.selector.$popup.find('.tablesorter-column-selector')
263 .html( colSel.$container.html() )
264 .find('input').each(function() {
265 var indx = $(this).attr('data-column');
266 $(this).prop( 'checked', indx === 'auto' ? colSel.auto : colSel.states[indx] );
267 });
268 }
269 tsColSel.saveValues( c, wo );
270 tsColSel.adjustColspans( c, wo );
271 // trigger columnUpdate if auto is true (it gets skipped in updateCols()
272 if (colSel.auto) {
273 c.$table.triggerHandler(wo.columnSelector_updated);
274 }
275 },
276 addSelectors: function( wo, prefix, column ) {
277 var array = [],
278 temp = ' col:nth-child(' + column + ')';
279 array.push(prefix + temp + ',' + prefix + '_extra_table' + temp);
280 temp = ' tr:not(.' + wo.columnSelector_classHasSpan + ') th[data-column="' + ( column - 1 ) + '"]';
281 array.push(prefix + temp + ',' + prefix + '_extra_table' + temp);
282 temp = ' tr:not(.' + wo.columnSelector_classHasSpan + ') td:nth-child(' + column + ')';
283 array.push(prefix + temp + ',' + prefix + '_extra_table' + temp);
284 // for other cells in colspan columns
285 temp = ' tr td:not(' + prefix + wo.columnSelector_classHasSpan + ')[data-column="' + (column - 1) + '"]';
286 array.push(prefix + temp + ',' + prefix + '_extra_table' + temp);
287 return array;
288 },
289 updateBreakpoints: function(c, wo) {
290 var priority, col, column, breaks,
291 isHidden = [],
292 colSel = c.selector,
293 prefix = c.namespace + 'columnselector',
294 mediaAll = [],
295 breakpts = '';
296 if (wo.columnSelector_mediaquery && !colSel.auto) {
297 colSel.$breakpoints.prop('disabled', true);
298 colSel.$style.prop('disabled', false);
299 return;
300 }
301 if (wo.columnSelector_mediaqueryHidden) {
302 // add columns to be hidden; even when "auto" is set - see #964
303 for ( column = 0; column < c.columns; column++ ) {
304 col = ts.getColumnData( c.table, c.headers, column );
305 isHidden[ column + 1 ] = ts.getData( c.$headerIndexed[ column ], col, 'columnSelector' ) === 'false';
306 if ( isHidden[ column + 1 ] ) {
307 // hide columnSelector false column (in auto mode)
308 mediaAll = mediaAll.concat( tsColSel.addSelectors( wo, prefix, column + 1 ) );
309 }
310 }
311 }
312 // only 6 breakpoints (same as jQuery Mobile)
313 for (priority = 0; priority < wo.columnSelector_maxPriorities; priority++) {
314 /*jshint loopfunc:true */
315 breaks = [];
316 c.$headers.filter('[' + wo.columnSelector_priority + '=' + (priority + 1) + ']').each(function() {
317 column = parseInt($(this).attr('data-column'), 10) + 1;
318 // don't reveal columnSelector false columns
319 if ( !isHidden[ column ] ) {
320 breaks = breaks.concat( tsColSel.addSelectors( wo, prefix, column ) );
321 }
322 });
323 if (breaks.length) {
324 mediaAll = mediaAll.concat( breaks );
325 breakpts += tsColSel.queryBreak
326 .replace(/\[size\]/g, wo.columnSelector_breakpoints[priority])
327 .replace(/\[columns\]/g, breaks.join(','));
328 }
329 }
330 if (colSel.$style) {
331 colSel.$style.prop('disabled', true);
332 }
333 if (mediaAll.length) {
334 colSel.$breakpoints
335 .prop('disabled', false)
336 .text( tsColSel.queryAll.replace(/\[columns\]/g, mediaAll.join(',')) + breakpts );
337 }
338 },
339 updateCols: function(c, wo) {
340 if (wo.columnSelector_mediaquery && c.selector.auto || c.selector.isInitializing) {
341 return;
342 }
343 var column,
344 colSel = c.selector,
345 styles = [],
346 prefix = c.namespace + 'columnselector';
347 colSel.$container.find('input[data-column]').filter('[data-column!="auto"]').each(function() {
348 if (!this.checked) {
349 column = parseInt( $(this).attr('data-column'), 10 ) + 1;
350 styles = styles.concat( tsColSel.addSelectors( wo, prefix, column ) );
351 }
352 $(this).toggleClass( wo.columnSelector_cssChecked, this.checked );
353 });
354 if (wo.columnSelector_mediaquery) {
355 colSel.$breakpoints.prop('disabled', true);
356 }
357 if (colSel.$style) {
358 colSel.$style.prop('disabled', false).text( styles.length ? styles.join(',') + ' { display: none; }' : '' );
359 }
360 tsColSel.saveValues( c, wo );
361 tsColSel.adjustColspans( c, wo );
362 c.$table.triggerHandler(wo.columnSelector_updated);
363 },
364
365 setUpColspan: function(c, wo) {
366 var index, span, nspace,
367 $window = $( window ),
368 hasSpans = false,
369 $cells = c.$table
370 .add( $(c.namespace + '_extra_table') )
371 .children()
372 .children('tr')
373 .children('th, td'),
374 len = $cells.length;
375 for ( index = 0; index < len; index++ ) {
376 span = $cells[ index ].colSpan;
377 if ( span > 1 ) {
378 hasSpans = true;
379 $cells.eq( index )
380 .addClass( c.namespace.slice( 1 ) + 'columnselector' + wo.columnSelector_classHasSpan )
381 .attr( 'data-col-span', span );
382 // add data-column values
383 ts.computeColumnIndex( $cells.eq( index ).parent().addClass( wo.columnSelector_classHasSpan ) );
384 }
385 }
386 // only add resize end if using media queries
387 if ( hasSpans && wo.columnSelector_mediaquery ) {
388 nspace = c.namespace + 'columnselector';
389 // Setup window.resizeEnd event
390 $window
391 .off( nspace )
392 .on( 'resize' + nspace, ts.window_resize )
393 .on( 'resizeEnd' + nspace, function() {
394 // IE calls resize when you modify content, so we have to unbind the resize event
395 // so we don't end up with an infinite loop. we can rebind after we're done.
396 $window.off( 'resize' + nspace, ts.window_resize );
397 tsColSel.adjustColspans( c, wo );
398 $window.on( 'resize' + nspace, ts.window_resize );
399 });
400 }
401 },
402
403 // Extracted from buildHeaders in core; needed for scroller widget compatibility
404 findHeaders : function(c) {
405 var indx, $temp,
406 sel = '.' + ts.css.scrollerHeader + ' thead > tr > ',
407 $headers = $(sel + 'th,' + sel + 'td'),
408 result = [];
409 for ( indx = 0; indx < c.columns; indx++ ) {
410 // Use $headers.parent() in case selectorHeaders doesn't point to the th/td
411 $temp = $headers.filter( '[data-column="' + indx + '"]' );
412 // target sortable column cells, unless there are none, then use non-sortable cells
413 // .last() added in jQuery 1.4; use .filter(':last') to maintain compatibility with jQuery v1.2.6
414 result[ indx ] = $temp.length ?
415 $temp.not( '.sorter-false' ).length ?
416 $temp.not( '.sorter-false' ).filter( ':last' ) :
417 $temp.filter( ':last' ) :
418 $();
419 }
420 return result;
421 },
422
423 adjustColspans: function(c, wo) {
424 var index, cols, col, span, end, $cell,
425 colSel = c.selector,
426 filtered = wo.filter_filteredRow || 'filtered',
427 autoModeOn = wo.columnSelector_mediaquery && colSel.auto,
428 // find all header/footer cells in case a regular column follows a colspan; see #1238
429 $headers = c.$table.children( 'thead, tfoot' ).children().children()
430 .add( $(c.namespace + '_extra_table').children( 'thead, tfoot' ).children().children() )
431 // include grouping widget headers (they have colspans!)
432 .add( c.$table.find( '.group-header' ).children() ),
433 len = $headers.length,
434 $headerIndexed = ts.hasWidget(c.table, 'scroller')
435 ? tsColSel.findHeaders(c)
436 : c.$headerIndexed;
437 for ( index = 0; index < len; index++ ) {
438 $cell = $headers.eq(index);
439 col = parseInt( $cell.attr('data-column'), 10 ) || $cell[0].cellIndex;
440 span = parseInt( $cell.attr('data-col-span'), 10 ) || 1;
441 end = col + span;
442 if ( span > 1 ) {
443 for ( cols = col; cols < end; cols++ ) {
444 if ( !autoModeOn && colSel.states[ cols ] === false ||
445 autoModeOn && $headerIndexed[ cols ] && !$headerIndexed[ cols ].is(':visible') ) {
446 span--;
447 }
448 }
449 if ( span ) {
450 $cell.removeClass( filtered )[0].colSpan = span;
451 } else {
452 $cell.addClass( filtered );
453 }
454 } else if ( typeof colSel.states[ col ] !== 'undefined' && colSel.states[ col ] !== null ) {
455 $cell.toggleClass( filtered, !autoModeOn && !colSel.states[ col ] );
456 }
457 }
458 },
459
460 saveValues : function( c, wo ) {
461 if ( wo.columnSelector_saveColumns && ts.storage ) {
462 var colSel = c.selector;
463 ts.storage( c.$table[0], 'tablesorter-columnSelector-auto', { auto : colSel.auto } );
464 ts.storage( c.$table[0], 'tablesorter-columnSelector', colSel.states );
465 }
466 },
467
468 attachTo : function(table, elm) {
469 table = $(table)[0];
470 var colSel, wo, indx,
471 c = table.config,
472 $popup = $(elm);
473 if ($popup.length && c) {
474 if (!$popup.find('.tablesorter-column-selector').length) {
475 // add a wrapper to add the selector into, in case the popup has other content
476 $popup.append('<span class="tablesorter-column-selector"></span>');
477 }
478 colSel = c.selector;
479 wo = c.widgetOptions;
480 $popup.find('.tablesorter-column-selector')
481 .html( colSel.$container.html() )
482 .find('input').each(function() {
483 var indx = $(this).attr('data-column'),
484 isChecked = indx === 'auto' ? colSel.auto : colSel.states[indx];
485 $(this)
486 .toggleClass( wo.columnSelector_cssChecked, isChecked )
487 .prop( 'checked', isChecked );
488 });
489 colSel.$popup = $popup.on('change', 'input', function() {
490 if (!colSel.isInitializing) {
491 if (tsColSel.checkChange(c, this.checked)) {
492 // data input
493 indx = $(this).toggleClass( wo.columnSelector_cssChecked, this.checked ).attr('data-column');
494 // update original popup
495 colSel.$container.find('input[data-column="' + indx + '"]')
496 .prop('checked', this.checked)
497 .trigger('change');
498 } else {
499 this.checked = !this.checked;
500 return false;
501 }
502 }
503 });
504 }
505 }
506
507 };
508
509 /* Add window resizeEnd event (also used by scroller widget) */
510 ts.window_resize = function() {
511 if ( ts.timer_resize ) {
512 clearTimeout( ts.timer_resize );
513 }
514 ts.timer_resize = setTimeout( function() {
515 $( window ).trigger( 'resizeEnd' );
516 }, 250 );
517 };
518
519 ts.addWidget({
520 id: 'columnSelector',
521 priority: 10,
522 options: {
523 // target the column selector markup
524 columnSelector_container : null,
525 // column status, true = display, false = hide
526 // disable = do not display on list
527 columnSelector_columns : {},
528 // remember selected columns
529 columnSelector_saveColumns: true,
530
531 // container layout
532 columnSelector_layout : '<label><input type="checkbox">{name}</label>',
533 // layout customizer callback called for each column
534 // function($cell, name, column) { return name || $cell.html(); }
535 columnSelector_layoutCustomizer : null,
536 // data attribute containing column name to use in the selector container
537 columnSelector_name : 'data-selector-name',
538
539 /* Responsive Media Query settings */
540 // enable/disable mediaquery breakpoints
541 columnSelector_mediaquery : true,
542 // toggle checkbox name
543 columnSelector_mediaqueryName : 'Auto: ',
544 // breakpoints checkbox initial setting
545 columnSelector_mediaqueryState : true,
546 // hide columnSelector false columns while in auto mode
547 columnSelector_mediaqueryHidden : false,
548 // set the maximum and/or minimum number of visible columns
549 columnSelector_maxVisible : null,
550 columnSelector_minVisible : null,
551
552 // responsive table hides columns with priority 1-6 at these breakpoints
553 // see http://view.jquerymobile.com/1.3.2/dist/demos/widgets/table-column-toggle/#Applyingapresetbreakpoint
554 // *** set to false to disable ***
555 columnSelector_breakpoints : [ '20em', '30em', '40em', '50em', '60em', '70em' ],
556 // maximum number of priority settings; if this value is changed (especially increased),
557 // then make sure to modify the columnSelector_breakpoints - see #1204
558 columnSelector_maxPriorities : 6,
559 // data attribute containing column priority
560 // duplicates how jQuery mobile uses priorities:
561 // http://view.jquerymobile.com/1.3.2/dist/demos/widgets/table-column-toggle/
562 columnSelector_priority : 'data-priority',
563 // class name added to checked checkboxes - this fixes an issue with Chrome not updating FontAwesome
564 // applied icons; use this class name (input.checked) instead of input:checked
565 columnSelector_cssChecked : 'checked',
566 // class name added to rows that have a span (e.g. grouping widget & other rows inside the tbody)
567 columnSelector_classHasSpan : 'hasSpan',
568 // event triggered when columnSelector completes
569 columnSelector_updated : 'columnUpdate'
570 },
571 init: function(table, thisWidget, c, wo) {
572 tsColSel.init(table, c, wo);
573 },
574 remove: function(table, c, wo, refreshing) {
575 var csel = c.selector;
576 if ( refreshing || !csel ) { return; }
577 if ( csel ) { csel.$container.empty(); }
578 if ( csel.$popup ) { csel.$popup.empty(); }
579 csel.$style.remove();
580 csel.$breakpoints.remove();
581 $( c.namespace + 'columnselector' + wo.columnSelector_classHasSpan )
582 .removeClass( wo.filter_filteredRow || 'filtered' );
583 c.$table.find('[data-col-span]').each(function(indx, el) {
584 var $el = $(el);
585 $el.attr('colspan', $el.attr('data-col-span'));
586 });
587 c.$table.off('updateAll' + namespace + ' update' + namespace);
588 }
589
590 });
591
592 })(jQuery);