From 7076a68d35aa2d91f1e68d7a72a68678ced83512 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 27 Feb 2025 18:38:10 +0000 Subject: [PATCH] Wrap table results in PDF Signed-off-by: snipe --- app/Presenters/AssetMaintenancesPresenter.php | 6 ------ resources/views/partials/bootstrap-table.blade.php | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/Presenters/AssetMaintenancesPresenter.php b/app/Presenters/AssetMaintenancesPresenter.php index a9640790d1..0648613adb 100644 --- a/app/Presenters/AssetMaintenancesPresenter.php +++ b/app/Presenters/AssetMaintenancesPresenter.php @@ -90,12 +90,6 @@ class AssetMaintenancesPresenter extends Presenter 'searchable' => true, 'sortable' => true, 'title' => trans('admin/asset_maintenances/form.asset_maintenance_type'), - ], [ - 'field' => 'title', - 'searchable' => true, - 'sortable' => true, - 'switchable' => false, - 'title' => trans('admin/asset_maintenances/form.title'), ], [ 'field' => 'start_date', 'searchable' => true, diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 70c10edff9..f4d539e995 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -30,6 +30,9 @@ export_options = data_export_options ? JSON.parse(data_export_options) : {}; export_options['htmlContent'] = false; // this is already the default; but let's be explicit about it export_options['jspdf']= {"orientation": "l"}; + export_options['jspdf'] = {"autotable": {"styles": {overflow: 'linebreak'}, + tableWidth: 'wrap'}}; + // tableWidth: 'wrap', // the following callback method is necessary to prevent XSS vulnerabilities // (this is taken from Bootstrap Tables's default wrapper around jQuery Table Export) export_options['onCellHtmlData'] = function (cell, rowIndex, colIndex, htmlData) {