我使用动态sql连接的DataTables方式。我想添加按钮导出 csv 和 xml,但它没有出现。还是我误会了。
oTable = $('#tbl_result').dataTable( { "sDom": 'T<"top"fl>rt<"bottom"pi>' , "sPaginationType": "full_numbers", “bAutoWidth”:假, “bProcessing”:是的, “bSortClasses”:假, “iDisplayLength”:15, “bStateSave”:假, “bServerSide”:是的, “语言”:{ "sUrl": "/includes/js/DataTables.fr.js" }, "sAjaxSource": "sql-objects.php", “oTableTools”:{ “aButtons”:[“csv”,“xls”], { “aButtons”:[“csv”、“xls”、“”] "sExtends": "收藏", } }, “fnRowCallback”:函数(nRow,aData,iDataIndex) { $('td:eq(1)', nRow).html( DateFr(aData['date']) ) ; $('td:eq(2)', nRow).html( ( aData['etat'] == '0' ? 'Inscrit' : 'En attente') ) ; $('td:eq(3)', nRow).html( '<a user="' + aData['mail'] + '" class="delete" href="?id_abonne='+ aData['mail '] +'"><img border="0" class="icon16 infobulle" src="/back_office/images/template/icon16-delete.png"></a>'); }, “aoColumns”: [ { "mData": "邮件" }, { "mData": "日期" }, {“mData”:“etat”}, {“mData”:“cle”,“bSortable”:假} ], “排序”: [ [0,'desc'] ] });
谢谢你