【发布时间】:2020-03-16 17:39:23
【问题描述】:
我是 JavaScript 新手。我在我的 PHP 应用程序中使用了如下数据表。一切正常。由于空间问题,我在表格中隐藏了一些列。我想用excel导出所有列。目前它只导出可见列。
<table class='table-striped' id='questions'
data-toggle="table"
data-url="get-list.php?table=question"
data-click-to-select="true"
data-side-pagination="server"
data-pagination="true"
data-page-list="[5, 10, 20, 50, 100, 200]"
data-search="true" data-show-columns="true"
data-show-refresh="true" data-trim-on-search="false"
data-sort-name="id" data-sort-order="desc"
data-mobile-responsive="true"
data-toolbar="#toolbar" data-show-export="true"
data-maintain-selected="true"
data-export-types='["txt","excel"]'
data-export-options='{
"fileName": "questions-list-<?=date('d-m-y')?>",
"ignoreColumn": ["state","IMAGE_FILE","operate"],
}'
data-query-params="queryParams_1"
>
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="ID" data-sortable="true">ID</th>
<th data-field="R_DATE" data-sortable="true" data-visible='false'>R DATE</th>
<th data-field="Q_NUM" data-sortable="true" data-visible='false'>Q NUM</th>
<th data-field="HIDDEN_IMAGE" data-visible="false">IMAGE</th>
<th data-field="IMAGE_FILE" data-sortable="false">Image</th>
<th data-field="Q_TYPE" data-sortable="true">Q TYPE</th>
<th data-field="SOURCE_TYPE" data-sortable="true">S TYPE</th>
<th data-field="SOURCE" data-sortable="true">SOURCE</th>
<th data-field="S_CAT" data-sortable="true">S CAT</th>
<th data-field="CAT" data-sortable="true">CAT</th>
<th data-field="QUESTION" data-sortable="true">Question</th>
<th data-field="A1" data-sortable="true">A1</th>
<th data-field="A2" data-sortable="true" data-visible='false'>A2</th>
<th data-field="A3" data-sortable="true" data-visible='false'>A3</th>
<th data-field="A4" data-sortable="true" data-visible='false'>A4</th>
<th data-field="operate" data-sortable="true" data-events="actionEvents">Operate</th>
</tr>
</thead>
</table>
我尝试了很多示例和问题答案,但没有一个解决了我的问题,如果有人可以帮助我,请告诉我。谢谢!
【问题讨论】:
-
我也有同样的问题,但我可以告诉你,你不应该浪费时间在 Datatables 网站上问这个问题。他们会简单地关闭它,甚至不回复,更不用说回答了。在他们所做的那个网站上有很多问题。如果我知道怎么做,我会在这里和你一起转圈。
标签: javascript jquery datatable datatables