带有导出选项的数据表应仅导出所选数据 [英] Data Table with export option should export only selected data

查看:150
本文介绍了带有导出选项的数据表应仅导出所选数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,我正在使用带有导出选项的数据表,但我的要求是.我必须下载带有搜索选项.例如,如果我通过位置过滤,则只需要下载这些部分.如果现在像我在表中使用过滤器并给出导出操作,它正在导出整个值.我已附上了另一张图片,我只下载了这些值而不是整个值(启用了搜索过滤器,位置为Software Engineer).因此,我将只下载具有软件工程师职位的数据.

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.

推荐答案

这里是一个通用示例.它将显示PDF按钮并仅导出过滤的行:

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'}
    }
  }]
});

这篇关于带有导出选项的数据表应仅导出所选数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆