mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge pull request #16378 from snipe/wrap_pdf_table_results
Wrap long text in PDF export in tables
This commit is contained in:
commit
a9ed9e2a7f
|
@ -90,12 +90,6 @@ class AssetMaintenancesPresenter extends Presenter
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
'sortable' => true,
|
'sortable' => true,
|
||||||
'title' => trans('admin/asset_maintenances/form.asset_maintenance_type'),
|
'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',
|
'field' => 'start_date',
|
||||||
'searchable' => true,
|
'searchable' => true,
|
||||||
|
|
|
@ -29,7 +29,16 @@
|
||||||
data_export_options = $(this).attr('data-export-options');
|
data_export_options = $(this).attr('data-export-options');
|
||||||
export_options = data_export_options ? JSON.parse(data_export_options) : {};
|
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['htmlContent'] = false; // this is already the default; but let's be explicit about it
|
||||||
export_options['jspdf']= {"orientation": "l"};
|
export_options['jspdf'] = {
|
||||||
|
"orientation": "l",
|
||||||
|
"autotable": {
|
||||||
|
"styles": {
|
||||||
|
overflow: 'linebreak'
|
||||||
|
},
|
||||||
|
tableWidth: 'wrap'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// tableWidth: 'wrap',
|
||||||
// the following callback method is necessary to prevent XSS vulnerabilities
|
// the following callback method is necessary to prevent XSS vulnerabilities
|
||||||
// (this is taken from Bootstrap Tables's default wrapper around jQuery Table Export)
|
// (this is taken from Bootstrap Tables's default wrapper around jQuery Table Export)
|
||||||
export_options['onCellHtmlData'] = function (cell, rowIndex, colIndex, htmlData) {
|
export_options['onCellHtmlData'] = function (cell, rowIndex, colIndex, htmlData) {
|
||||||
|
|
Loading…
Reference in a new issue