| 8 |
lars |
1 |
/**
|
|
|
2 |
* When DataTables removes columns from the display (`bVisible` or
|
|
|
3 |
* `fnSetColumnVis`) it removes these elements from the DOM, effecting the index
|
|
|
4 |
* value for the column positions. This function converts the data column index
|
|
|
5 |
* (i.e. all columns regardless of visibility) into a visible column index.
|
|
|
6 |
*
|
|
|
7 |
* DataTables 1.10+ has this ability built-in through the
|
|
|
8 |
* `dt-api column.index()` method. As such this method is marked deprecated, but
|
|
|
9 |
* is available for use with legacy version of DataTables.
|
|
|
10 |
*
|
|
|
11 |
* @name fnColumnIndexToVisible
|
|
|
12 |
* @summary Convert a column data index to a visible index.
|
|
|
13 |
* @author [Allan Jardine](http://sprymedia.co.uk)
|
|
|
14 |
* @deprecated
|
|
|
15 |
*
|
|
|
16 |
* @param {integer} iMatch Column data index to convert to visible index
|
|
|
17 |
* @returns {integer} Visible column index
|
|
|
18 |
*
|
|
|
19 |
* @example
|
|
|
20 |
* var table = $('#example').dataTable( {
|
|
|
21 |
* aoColumnDefs: [
|
|
|
22 |
* { bVisible: false, aTargets: [1] }
|
|
|
23 |
* ]
|
|
|
24 |
* } );
|
|
|
25 |
*
|
|
|
26 |
* // This will show 1
|
|
|
27 |
* alert( 'Column 2 visible index: '+table.fnColumnIndexToVisible(2) );
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
jQuery.fn.dataTableExt.oApi.fnColumnIndexToVisible = function ( oSettings, iMatch )
|
|
|
31 |
{
|
|
|
32 |
return oSettings.oApi._fnColumnIndexToVisible( oSettings, iMatch );
|
|
|
33 |
};
|