2016-05-05 7 views
0

DataTable用のツールの一部、特に印刷オプションを整列する方法を知る必要があります。あなたは、初期化中にテーブル全体ツールツールバーの移動Tの文字を移動したい場合はDataTable用のツールの整列

$("#tblNewUsers").dataTable({ 
     bProcessing: true, 
     sAjaxSource: '@Url.Action("GetAllNewUsers")', 
     bJQueryUI: true, 
     sProcessing: "<img src='~/Images/spinner.gif' />", 
     dom: 'Tlf<"clear">rtip', 
     bAutoWidth: false, 
     "oLanguage": { 
      sEmptyTable: "There are no New Users at this time" 
     }, 
     "aoColumns": [ 
      { "sWidth": "1%", sClass: "smallFonts" }, 
      { "sWidth": "15%", sClass: "smallFonts" }, 
      { "sWidth": "15%", sClass: "smallFonts" }, 
      { "sWidth": "15%", sClass: "smallfonts" }, 
      { "sWidth": "15%", sClass: "smallFonts" }, 
      { "sWidth": "15%", sClass: "smallFonts" }, 
      { "sWidth": "15%", sClass: "smallFonts" } 
     ], 
     tableTools: { 
      "sSwfPath": "../../Scripts/swf/copy_csv_xls_pdf.swf", 
      "aButtons": [ 
       { 
        "sExtends": "print", 
        "bShowAll": true 
       } 
      ] 

     } 
    }); 

答えて

1

:パラメータがこのようなものです

Print is not in line with search

:それはこのように表示されます。最後に全体のツールバーをプッシュする例は次のとおりです。

"sDom": '<"clear">lfrtipT' 

は、あなただけの印刷ボタンを移動するためのDataTableを再構成することはできませんが、いくつかの新しい位置にクラス「DTTT_button_print」でボタンを取るために、標準のjQueryのを使用することができます。

たとえば、次のように新しい要素

var printButton = $(".DTTT_button_print").detach(); 
$("#newPosition").append(pdfButton); 

に移動したり、追加CSS:

$(".DTTT_button_print").css("top","-20px"); 

結果:https://jsfiddle.net/jevtw2g4/11/