ソースを参照

Only export table header

Dustin Utecht 6 年 前
コミット
d45929bc93
1 ファイル変更9 行追加1 行削除
  1. 9 1
      src/extensions/export/bootstrap-table-export.js

+ 9 - 1
src/extensions/export/bootstrap-table-export.js

@@ -44,7 +44,15 @@ $.extend($.fn.bootstrapTable.defaults, {
   showExport: false,
   exportDataType: 'basic', // basic, all, selected
   exportTypes: ['json', 'xml', 'csv', 'txt', 'sql', 'excel'],
-  exportOptions: {},
+  exportOptions: {
+    onCellHtmlData: function (cell, rowIndex, colIndex, htmlData) {
+      if (cell.is('th')) {
+        return cell.find('.th-inner').text()
+      }
+
+      return htmlData;
+    }
+  },
   exportFooter: false
 })