There are text fields containing longer text with CR/LF. But they are no visible in list view. When I click on inline edit, the breaks become visible. But I need them in list view for readability.
The setting "Replace CR +LF by <br>" seems to have no effect and I read in manual, that this does only work for memo fields.
What am I missing?
CR/LF not visible in TextArea List View
-
- User
- Posts: 7
CR/LF not visible in TextArea List View
-
- User
- Posts: 7
Okay, just created a complete new project with the exact same view. Guess what... your code works in this project. I think I have to make some comparisons between the projects to find the difference. Strange!
Thank you for your help :) When I find out, what caused the error, I will post it here.
-
- User
- Posts: 9785
That is because the "Max length (List page)" option tries to show long data by a one-line short text like "Some long string..." in a table column in the List page, it will remove the white spaces first, but in your particular case you use a rather large number 2000 so you may still want line breaks. In such case you may disable "Max length (List page)", enable "Replace CR +LF by <br>" and use Row_Rendered server event to truncate, e.g.
$this->MyField->ViewValue = TruncateMemo($this->MyField->ViewValue, 2000);
-
- User
- Posts: 579
How can i get dompdf to obey CR/LF ?
according to this css white-space: pre-line should work, but it doesn't:
https://github.com/dompdf/dompdf/issues/1814
any ideas?
-
- User
- Posts: 9785
PDF is exported by ExportPdf class, you should customize the class (see viewtopic.php?t=50364) or the ewpdf.css.
-
- User
- Posts: 579
Adding white-space: pre-wrap; to .ew-table td in ew.pdf fixed it.
.ew-table td, .ew-table th {
padding: 3px;
border: 0.5px solid;
border-color: #DEE2E6;
white-space: pre-wrap;
}
Is there a way to set this in user styles, so it doesn't get overwritten when generating files ?
-
- User
- Posts: 9785
You may copy the original dompdf extension and customize it as your own. Also read Making Extensions.