height of row when text with many lines

Questionsheight of row when text with many lines
Don asked 5 years ago

Hi Abu,

I have some fields which are text and hence can have linefeeds, that makes some of the row as high as lines in the text are. Can this height be fixed? or the lines feeds removed (in the view) from it so it shows as a one-liner?

Here a screen shot: https://imgur.com/a/uAF0zje

Thanks,

Don.

7 Answers
Abu Ghufran Staff answered 5 years ago

Please check if you are using following CSS on your page. If yes then remove it to have it one liner.

How-Tos & FAQs

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Don answered 5 years ago

Well, I wasn’t using that CSS, then I tried and neither with or without solves the issue. Screenshot with the CSS (whitout the CSS looks like in the previous screenshot): https://imgur.com/a/PdlS9OB

As you see, with the CSS all the rows look tall and the one with the long comment even taller.

This is a comment field, and can have line-feeds (the \r\n or carriage return + line feed), and is inserted by an external script, it receives from a textbox and then

$comment = htmlentities(filter_var($_POST['comment'], FILTER_SANITIZE_STRING), ENT_QUOTES, 'UTF-8');

and then

$sql->bindParam(':comment', $comment, PDO::PARAM_STR); at the insert. If the comment doesn’t have any line feeds/carriage returns (that means pressing the enter key while writing the comment) then works as expected:
https://imgur.com/a/E76ioPm
Hope we can find a solution.
BTW, happy workers day!
Don

Abu Ghufran Staff answered 5 years ago

To regenerate case, Please email me your sql dump and grid code at [email protected].
It’s coming on new line only when your cell content contains <br>.
Otherwise \n or \r\n comes as it is, like “Test \r\n Test2”

comes as:

 

Can you confirm what exactly is in your database?

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Don answered 5 years ago

Hi, All sent, please check you spam folder just in case hehe.

Abu Ghufran Staff answered 5 years ago

You can use on_data_display event handler to remove new lines at the time of display.

https://php-fiddle.com/5eb7f89309a60/2

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Don answered 5 years ago

Thanks Abu, it works as expected.

Do you think is it a issue with my database or is it a normal behaviour from textboxes and how enters behave?

Abu Ghufran Staff answered 5 years ago

Yes, it’s normal behavior. I was testing differently and regenerated your case today.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

9 + 20 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?