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
You can set grid option \’rowheight\’ to desired value. e.g.
$opt["rowheight"] = 80;
where $opt is passed to set_options() function.
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
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
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.
Excellent suggestion – thank you. I’ll see if I can get that working in my environment.
Thanks
Mike
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
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.
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;
}