jquery数据表插件启用多个功能

时间:2013-09-21 11:13:42

标签: jquery datatables extras

jquery数据表插件启用多个功能

jquery datatables extras

您好我正在使用带有ColVis和TableTools附加功能的DataTables jquery插件。以下代码工作正常:

  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/image_slide.js"></script>
  <script type="text/javascript" charset="utf-8" src="libs/DataTables/media/js/jquery.dataTables.js"></script>
  <script type="text/javascript" charset="utf-8" src="libs/DataTables/extras/ColVis/media/js/ColVis.js"></script>
  <script type="text/javascript" charset="utf-8" src="libs/DataTables/extras/TableTools/media/js/TableTools.js"></script>
  <script type="text/javascript" charset="utf-8" src="libs/DataTables/extras/TableTools/media/js/ZeroClipboard.js"></script>
  <script type="text/javascript" charset="utf-8" src="libs/DataTables/extras/ColReorder/media/js/ColReorder.js"></script>
  <style type="text/css" title="currentStyle">
  @import "libs/DataTables/extras/TableTools/media/css/TableTools.css";
  @import "libs/DataTables/media/css/demo_table.css";
  @import "libs/DataTables/extras/ColVis/media/css/ColVis.css";
  @import "libs/DataTables/extras/ColReorder/media/css/ColReorder.css";
  </style>
  <script>

$(document).ready( function () {
    $('#results').dataTable( {
        "sDom": 'T<"clear">Clfrtip',

        "oTableTools": {
            "sSwfPath": "http://192.168.78.7/cdtc/app/custom/libs/DataTables/extras/TableTools/media/swf/copy_csv_xls_pdf.swf",

              "aButtons": [



                {
                    "sExtends":    "collection",
                    "sButtonText": "Guardar",
                    "aButtons":    [ "csv", "pdf" ]
                },
                {
                    "sExtends":    "copy",
                    "sButtonText": "Copiar",
                    "sInfo": "Todos los registros fueron copiados al portapapeles"

                },
                {
                    "sExtends":    "print",
                    "sButtonText": "Imprimir",
                    "sInfo": "Vista previa impresión, presione la tecla ImprPant para imprimir. Presione Escape para salir de la vista previa"
                }


            ]

        },

        "oColVis": {
            "buttonText": "Mostrar/Ocultar Columnas",

        },

        "oLanguage": {
      "sLengthMenu": "Mostrar _MENU_ registros por página",
      "sZeroRecords": "No se encontro nada",
      "sInfo": "Mostrando _START_ a _END_ de _TOTAL_ registros",
      "sInfoEmpty": "Mostrando 0 to 0 of 0 registros",
      "sSearch":         "Buscar:",
      "oPaginate": {
        "sFirst":    "Primero",
        "sLast":     "Último",
        "sNext":     "Siguiente",
        "sPrevious": "Anterior "

    },
      "sInfoFiltered": "(filtered de _MAX_ total registros)"

    }
    } );
} );
</script>

但是当我尝试添加额外的ColReorder时,所有插件都停止运行。我尝试使用以下代码将R添加到上一个代码中:

 $('#results').dataTable( {
            "sDom": 'T<"clear">RClfrtip',

有什么想法吗?提前谢谢。

0 个答案:

没有答案