public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js
function ( oState )
	{
		var i, iLen, aCopy, iOrigColumn;
		var oSettings = this.s.dt;
		var columns = oSettings.aoColumns;

		oState.ColReorder = [];

		/* Sorting */
		if ( oState.aaSorting ) {
			// 1.10.0-
			for ( i=0 ; i<oState.aaSorting.length ; i++ ) {
				oState.aaSorting[i][0] = columns[ oState.aaSorting[i][0] ]._ColReorder_iOrigCol;
			}

			var aSearchCopy = $.extend( true, [], oState.aoSearchCols );

			for ( i=0, iLen=columns.length ; i<iLen ; i++ )
			{
				iOrigColumn = columns[i]._ColReorder_iOrigCol;

				/* Column filter */
				oState.aoSearchCols[ iOrigColumn ] = aSearchCopy[i];

				/* Visibility */
				oState.abVisCols[ iOrigColumn ] = columns[i].bVisible;

				/* Column reordering */
				oState.ColReorder.push( iOrigColumn );
			}
		}
		else if ( oState.order ) {
			// 1.10.1+
			for ( i=0 ; i<oState.order.length ; i++ ) {
				oState.order[i][0] = columns[ oState.order[i][0] ]._ColReorder_iOrigCol;
			}

			var stateColumnsCopy = $.extend( true, [], oState.columns );

			for ( i=0, iLen=columns.length ; i<iLen ; i++ )
			{
				iOrigColumn = columns[i]._ColReorder_iOrigCol;

				/* Columns */
				oState.columns[ iOrigColumn ] = stateColumnsCopy[i];

				/* Column reordering */
				oState.ColReorder.push( iOrigColumn );
			}
		}
	}
function ( oState )
	{
		var i, iLen, aCopy, iOrigColumn;
		var oSettings = this.s.dt;
		var columns = oSettings.aoColumns;

		oState.ColReorder = [];

		/* Sorting */
		if ( oState.aaSorting ) {
			// 1.10.0-
			for ( i=0 ; i<oState.aaSorting.length ; i++ ) {
				oState.aaSorting[i][0] = columns[ oState.aaSorting[i][0] ]._ColReorder_iOrigCol;
			}

			var aSearchCopy = $.extend( true, [], oState.aoSearchCols );

			for ( i=0, iLen=columns.length ; i<iLen ; i++ )
			{
				iOrigColumn = columns[i]._ColReorder_iOrigCol;

				/* Column filter */
				oState.aoSearchCols[ iOrigColumn ] = aSearchCopy[i];

				/* Visibility */
				oState.abVisCols[ iOrigColumn ] = columns[i].bVisible;

				/* Column reordering */
				oState.ColReorder.push( iOrigColumn );
			}
		}
		else if ( oState.order ) {
			// 1.10.1+
			for ( i=0 ; i<oState.order.length ; i++ ) {
				oState.order[i][0] = columns[ oState.order[i][0] ]._ColReorder_iOrigCol;
			}

			var stateColumnsCopy = $.extend( true, [], oState.columns );

			for ( i=0, iLen=columns.length ; i<iLen ; i++ )
			{
				iOrigColumn = columns[i]._ColReorder_iOrigCol;

				/* Columns */
				oState.columns[ iOrigColumn ] = stateColumnsCopy[i];

				/* Column reordering */
				oState.ColReorder.push( iOrigColumn );
			}
		}
	}
function ( oState ) { var i , iLen , aCopy , iOrigColumn ; var oSettings = this . s . dt ; var columns = oSettings . aoColumns ; oState . ColReorder = [ ] ; /* Sorting */ if ( oState . aaSorting ) { // 1.10.0- for ( i = 0 ; i < oState . aaSorting . length ; i ++ ) { oState . aaSorting [ i ] [ 0 ] = columns [ oState . aaSorting [ i ] [ 0 ] ] . _ColReorder_iOrigCol ; } var aSearchCopy = $ . extend ( true , [ ] , oState . aoSearchCols ) ; for ( i = 0 , iLen = columns . length ; i < iLen ; i ++ ) { iOrigColumn = columns [ i ] . _ColReorder_iOrigCol ; /* Column filter */ oState . aoSearchCols [ iOrigColumn ] = aSearchCopy [ i ] ; /* Visibility */ oState . abVisCols [ iOrigColumn ] = columns [ i ] . bVisible ; /* Column reordering */ oState . ColReorder . push ( iOrigColumn ) ; } } else if ( oState . order ) { // 1.10.1+ for ( i = 0 ; i < oState . order . length ; i ++ ) { oState . order [ i ] [ 0 ] = columns [ oState . order [ i ] [ 0 ] ] . _ColReorder_iOrigCol ; } var stateColumnsCopy = $ . extend ( true , [ ] , oState . columns ) ; for ( i = 0 , iLen = columns . length ; i < iLen ; i ++ ) { iOrigColumn = columns [ i ] . _ColReorder_iOrigCol ; /* Columns */ oState . columns [ iOrigColumn ] = stateColumnsCopy [ i ] ; /* Column reordering */ oState . ColReorder . push ( iOrigColumn ) ; } } }
Because we change the indexes of columns in the table, relative to their starting point
we need to reorder the state columns to what they are at the starting point so we can
then rearrange them again on state load!
@method  _fnStateSave
@param   object oState DataTables state
@returns string JSON encoded cookie string for DataTables
@private
Because we change the indexes of columns in the table relative to their starting point we need to reorder the state columns to what they are at the starting point so we can then rearrange them again on state load!