Skip to content

Commit a9ed9e2

Browse files
authored
Merge pull request #16378 from snipe/wrap_pdf_table_results
Wrap long text in PDF export in tables
2 parents 3928c8a + ce8523b commit a9ed9e2

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

app/Presenters/AssetMaintenancesPresenter.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,6 @@ public static function dataTableLayout()
9090
'searchable' => true,
9191
'sortable' => true,
9292
'title' => trans('admin/asset_maintenances/form.asset_maintenance_type'),
93-
], [
94-
'field' => 'title',
95-
'searchable' => true,
96-
'sortable' => true,
97-
'switchable' => false,
98-
'title' => trans('admin/asset_maintenances/form.title'),
9993
], [
10094
'field' => 'start_date',
10195
'searchable' => true,

resources/views/partials/bootstrap-table.blade.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@
2929
data_export_options = $(this).attr('data-export-options');
3030
export_options = data_export_options ? JSON.parse(data_export_options) : {};
3131
export_options['htmlContent'] = false; // this is already the default; but let's be explicit about it
32-
export_options['jspdf']= {"orientation": "l"};
32+
export_options['jspdf'] = {
33+
"orientation": "l",
34+
"autotable": {
35+
"styles": {
36+
overflow: 'linebreak'
37+
},
38+
tableWidth: 'wrap'
39+
}
40+
};
41+
// tableWidth: 'wrap',
3342
// the following callback method is necessary to prevent XSS vulnerabilities
3443
// (this is taken from Bootstrap Tables's default wrapper around jQuery Table Export)
3544
export_options['onCellHtmlData'] = function (cell, rowIndex, colIndex, htmlData) {

0 commit comments

Comments
 (0)