2017-08-07 11 views
1

データテーブルをエクスポートしようとしていますが、その中にツールチップがあります。私はそれがツールチップの情報を持っているExcelにテーブルをエクスポートするときdivエクスポートデータテーブルを非表示にする

Tooltip Demo

問題がある:これは進行中の内部プログレスバーとツールチップでのデータテーブルです。このように: enter image description here

私はちょうど100%を表示します。ここで私は私のPHPコード

<td> 
    <div class="progress"> 
    <div class='<?=barra($institucional); ?>' role="progressbar" style="width:<?=$institucional;?>%"> 
     <?=$institucional;?>% 
    </div> 
    <div class="info" style="display: none;"> 
     <strong>Acción:</strong> <?=round($row['accion']/3,2);?>%<br> 
     <strong>Eje:</strong> <?=round($row['eje']/3,2);?>%<br> 
     <strong>Programa:</strong> <?=round($row['programa']/3,2);?>%<br> 
    </div> 
    </div> 

持っており、これはすべての私のプログレスバーは、データ用を持っている情報隠されたdiv要素を持っている、

$(".progress").each(function() { 
    var contenido = $(this).children('.info:hidden').html() 
    $(this).popover({title: "", content: contenido, html: true, placement: "left", trigger:'hover', container: 'body'}); 
    }); 

だから、ツールチップを作成するために、私のJavascriptのコードですツールチップ。私はそのツールチップのデータをエクスポートしたくありません。

var buttonCommon = { exportOptions: { 
         format: { 
         body: function (data, row, column, node) { 
         // here you must get which column you want to change the data, it using number not column name, column number start from 0 
         return column === 5 ? 'your desired value' : data; 
        } 
       } 
      } 
     }; 

$('#example').DataTable({ 
    ajax: "ajax_data.txt", 
    columns: [ 
     { data: 'name' }, 
     { data: 'position' }, 
     { data: 'office' }, 
     { data: 'extn' }, 
     { data: 'start_date' }, 
     { data: 'salary' } 
    ], 
    dom: 'Bfrtip', 
    buttons: [ 
     $.extend(true, {}, buttonCommon, { 
     extend: 'csv' 
     }) 
    ] 
}); 

だから、エクスポートボタンをクリックしたとき、それはあなたの目的のデータに基づいてデータの出力を変更します:

答えて

関連する問題