Data Table with export option should export only selected data

我们两清 提交于 2019-12-12 02:47:27

问题


Friends I'm using data table with export option but my requirement is . I have to download with search option . For example if I filter through position only those portion has to be downloaded . Where as now if I use the filter in table and give the export It is exporting whole value . I have attached The another image which I've to download only those values and not the whole value( Search filter enabled with position as Software Engineer) . So I will download only the data with position as software engineer.


回答1:


Here is a generic example. It will show the PDF button and export only filtered rows :

$('#example').DataTable( {
  dom: 'Bfrtip',
  buttons: [{
    extend: 'pdfHtml5',
    exportOptions : {
      rows : {search:'applied'}
    }
  }]
});


来源:https://stackoverflow.com/questions/33579477/data-table-with-export-option-should-export-only-selected-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!