Weblistbox Scrollbar is off when row height is smaller

When changing the row height of a weblistbox, the scrollbar still seems to calculate it’s position based on the original height

Does anyone know how fix this?

I’m using this in the html header to change the row height.

.table-striped tbody { line-height: 0.2; }

Thanks!

What I see is that Xojo is adding the following code to the scroll body after the table:

<div style="position: relative; top: 0px; left: 0px; width: 1px; height: 2450px;"></div>

but I don’t know the reason.

Now that you changed the row height, the height for the 50 rows (if you have 1 to 50) is 1409 and not 2450 but the above code makes the area to scroll past Row: 50 for many more blank rows.

We can remove the code but I don’t know what we will break with that change.

In the listbox Shown event:

ExecuteJavaScript("$('#"+me.ControlID+"_table').next().remove();")

In the webpage Resized event the same:

ExecuteJavaScript("$('#"+listbox1.ControlID+"_table').next().remove();")

Let me know if you use this and if this breaks something.

This code solves the problem with the scroll bars and doesn’t seem to cause any issues. I don’t know why the div following the table exists, as it doesn’t seem to do anything useful.

Thanks!

1 Like

Actually, There is a problem. When the listbox is set to resize vertically with the window, and the window is set to a small height, when the scrollbar is all the way to the bottom, some of the rows are not displayed. So for now, I’m going to use the default row height.

We will need to wait for your Feature Request:
#71427 - Please add a property or method to set the row height and header height on WebListBox

1 Like