Set Maximum Row Height

QuestionsSet Maximum Row Height
MIke asked 3 years ago

I would like to set a maximum row-height – as sometimes I have a cell of data with long-text that is hundreds of lines long. I would prefer to set the row-height at say 80 pixels – but on a report-by-report basis, not globally.

Any thoughts?

 

Thanks

 

Mike

8 Answers
Abu Ghufran Staff answered 3 years ago

You can set grid option \’rowheight\’ to desired value. e.g.

$opt["rowheight"] = 80;

where $opt is passed to set_options() function.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
MIKE answered 3 years ago

Thanks for the quick feedback.

I wasn’t very clear in my question. I don’t want to set the row-height to 80 for every row – I want regular rows to be normal 1-line height, but if there is a field with many lines, I want to limit that to no-more than 80 pixels high.

Right now, even with a limit, some rows grow very large because the one field might have 30 or 40 lines of data in the text-field. I would like to have a MAX row-height, but also a standard row-height.

I hope that makes sense.

 

Thanks

 

Mike

MIKE answered 3 years ago

Thanks for the quick feedback.

I wasn’t very clear in my question. I don’t want to set the row-height to 80 for every row – I want regular rows to be normal 1-line height, but if there is a field with many lines, I want to limit that to no-more than 80 pixels high.

Right now, even with a limit, some rows grow very large because the one field might have 30 or 40 lines of data in the text-field. I would like to have a MAX row-height, but also a standard row-height.

I hope that makes sense.

 

Thanks

 

Mike

Abu Ghufran Staff answered 3 years ago

Another options is to use readmore plugin as in this demo:

It shows single line by default and expand when you click read more link.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Mike answered 3 years ago

Excellent suggestion – thank you. I’ll see if I can get that working in my environment.

 

Thanks

 

Mike

Mike answered 3 years ago

I was successful in getting that method to work – but the do_load() function makes the report super-slow to run. It runs in about 2-seconds without the function which increases to over 20-seconds with the function.

Any thoughts on how to speed-up the Processing? I understand it may be completely dependent on my database and settings . . . but I am hoping you’ve seen this behavior and have a quick suggestion.

Thanks

Mike

Abu Ghufran Staff answered 3 years ago

Seems like you have many records per page on grid. Adjusting each row might be taking time.

Please check again after limiting records per page OR lazy loading records on scroll down e.g.

$opt["rowNum"] = 10;

or

$opt["scroll"] = true;

If issue persist, you can send the grid code for review.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Mike answered 3 years ago

It’s definitely the number of rows being returned and this report has 24 columns of data. I suspect it’s just the number of rows being returned and the processing – it’s a good option so it might be worth the speed issue.

As an aside – the included demo where you can force the max-height of the cell actually solves my initial question – and if the speed is an issue, I can use the format/unformat and the Max RowHeight with no-loss of speed vs the standard report. I just set the height a bit taller and this works as well.

Thanks

Mike

.readmore {
max-height: 3.0em;
}

Your Answer

14 + 16 =

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?