jquery 数据表插件启用多种功能
jquery 数据表附加功能
嗨,我正在使用带有 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',
有任何想法吗?提前致谢。