Repeater Table - Help Needed - Resize Row Height to Fit Content When Text Wraps

repeater-widget

#1

I have a repeater table with 3 columns (checkbox column, ID column, Product Name column). In cases where product name is longer than fits, the text wraps to the next line. I need the row height to resize in that case to fit content and can’t seem to figure it out.

Repeater is set to “Fit to Content”
The row group height is NOT locked.
The height of the widgets that make up the cells are also NOT locked.

If I set the widget for the cell containing Product Name to Fit To Text Height, that cell in repeater table resizes, but the rest of the cells in the row group do not also resize.

My live example of above problem is at below link. I’ve also attached my rp file.
https://m0bl0t.axshare.com/

Repeater Table - Resize Row to Fit Content.rp (331.1 KB)


#2

If there’s only one cell that has the chance to wrap, you can use the [Item Loaded] event to set the height of the other cells to the height of the wrapped cell: Resize_Row_Height.rp (209.9 KB)


#3

Thank you! I’ve tried adding the [Item Loaded] code as you’ve suggested and checking it’s setup as your file, but it’s not working and I can’t figure out where I might be missing something. (The red text is the height of the Product Name cell. I left it visible to ensure the code was working to correctly set text on that box to the height of that cell).

Repeater Table - Resize Row to Fit Content v2.rp (443.4 KB)


#4

It took me a little bit but, I think I figured out what is going on.

The issue stems from the fact that, when the cells are populated with only one line of text, the cells actually have a smaller height than the starting widgets. (The widgets in the project are 30px high but, when populated, they shrink to 21px.)

There’s a hotspot inside the repeater with a height of 30px; it needs to be included as part of the resizing logic or set its original height to smaller than 21px.

The other issue is the position of the checkbox. Since it’s centered off of a 30px high cell, when the cell shrinks, it doesn’t re-center. You could add some logic to the repeater to move the checkbox, but the easiest thing to do is just add padding to the text cells to make sure they start at 30px.

I also noticed that the “wgt_BigCell” variable wasn’t set for resizing the “Unique ID” cell.