问题标签 [datatable-buttons]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
10046 浏览

php - 从数据表按钮中的导出中排除列

我的数据表有以下初始化:

我正在使用数据表按钮,因为 tabletools 已从数据表中弃用并尝试了许多选项:

也试过:

我尝试以各种方式应用不同的参数,但我的理解中缺少一些东西。请帮助。

谢谢。

0 投票
1 回答
1502 浏览

css - 如何修改导出文件中Header的CSS并在Export中的Header后添加空行?

我正在使用 Datatable Buttons 扩展,我想用背景颜色、粗体文本和字体颜色修改标题。我尝试了下面的代码但没有工作

另外,如何在 xls 或 CSV 的标题后添加空行?谢谢

0 投票
1 回答
1019 浏览

jquery - 如何解决非呈现 DataTable 导出按钮?

我正在遵循将文件导出添加 buttons到现有 DataTable 的指南。

但是当我运行 asp 解决方案时,导出按钮按预期工作,但它们不能正确呈现,只显示按钮的文本。

我已经重新检查了脚本引用的顺序,这些引用反映了上面链接的指南的设置。

问题:

为了呈现 DataTable 按钮,脚本的正确顺序是什么?

它们在运行时的样子:

导出按钮

他们应该是什么样子:

在此处输入图像描述

脚本和 HTML(要点):

0 投票
1 回答
1628 浏览

datatables - 数据表按钮 pdfHtml5 exportOptions 删除嵌套标签

我正在尝试优化页面的数据表按钮 pdfHtml5 导出。表格数据包含嵌套的 html 标签,这些标签在单元格数据的上方和下方创建了额外的空间,这使得 PDF 非常长。

我单元格中的文本包含在两个嵌套<div>和一个<p>. 在 PDF 导出中,我只需要<p>

我正在尝试使用 exportOptions 删除嵌套的 html 标签,但我不确定如何正确编写语法。谁能帮我这个?

0 投票
3 回答
5953 浏览

button - 当数据表为空时,我们如何禁用数据表导出按钮(或防止点击事件)?

我正在使用 datatable,当网格有空行时,我需要禁用导出按钮(Excel、PDF)。 我们如何处理数据表导出按钮的点击动作?

我已经完成了网格初始化,如下所示。我不知道如何处理数据表导出按钮(PDF、Excel)。你能帮我解决这个问题吗?

更新:

  1. 我还有一个问题,当用户单击 Excel 或 PDF 按钮时,网格列的宽度正在折叠。

我什至需要用户单击 Excel 或 PDF 按钮,网格列宽不应该改变。我们怎样才能做到这一点?

  1. 将数据导出到 excel 后,不会在 excel 中自动调整列。

    我们如何使列(将数据表数据导出到excel后)自动调整?

    /li>
0 投票
1 回答
917 浏览

datatables - jQuery datatables buttons defaults

I have some styles that I need to apply to all DataTables buttons so that they match the rest of the buttons on my site. I can add that using the className option as below, but I'd like not to have to supply the same thing every time.

Manual example

I see in the docs that the default value is undefined. I couldn't find anywhere in the docs that you could override the default for this or other options. Is this possible? Something like:

What I need is to be able to set the default for the plugin itself (rather than for a specific instance). Then all instances I create on the page from then on would have the default I specified. I can include the script that sets the default right after the plugin script (perhaps in a layout file) so that I never have to manually do anything to get all subsequent instances to have the default className (but still be able to override it by explicitly providing it as shown in the 'manual example' above).

0 投票
2 回答
8338 浏览

internet-explorer - 将 jquery 数据表导出到带有附加行的 Excel 不起作用 IE

我正在尝试使用 jquery 导出按钮选项将数据表导出到 excel 表。我希望在 excel 文件中的表数据之前添加额外的行。我在小提琴https://jsfiddle.net/xevpdeo1/17/中做了一个类似的演示。它在 Chrome 和 Firefox 中运行良好,但在 IE 中运行良好。在 IE 中,表数据之前的附加行在导出后为空。有人可以帮我解决这个问题吗?提前致谢

0 投票
1 回答
2640 浏览

jquery - PDF页面大小和方向中的dataTable问题

我使用数据表插件导出 pdf、csv、xls 和打印。我在 pdf 视图中遇到问题。

当我点击下载 pdf 按钮时,我的 pdf 文件数据没有全宽。请检查此链接 - https://datatables.net/extensions/buttons/examples/html5/pdfPage.html

截屏:

在此处输入图像描述

代码:

0 投票
0 回答
318 浏览

datatables - 数据表按钮 - ExcelHTML5 - 创建文件后的消息

我正在使用按钮扩展导出到 excel excelHtml5,我想知道它是否可以在创建 excel 文件后显示警报(或类似的东西)。

编辑:ExcelHTML5 按钮不是 TableTools 扩展,并且没有相同的选项,例如 fnComplete。

提前致谢。

0 投票
1 回答
770 浏览

jquery - Datatables Buttons Disapear After Reload

Im trying to make Excel, PDF and Print button, to my Datatables Result, well, i done it, but, when i reload the content of the datatable the excel and Print button disapear,

This is how i Send the information to the datatable

Here is the Methot of my datatable

here is the image when y press the search button by first time Imagen1

here is when i press again Imagen2