Xojo2024R4.1: how to display icon in the header column of the WebListBox that is using DataSource?

I have not looked.

EDIT:
This method won’t work with sortable columns. DataTables uses :before and :after for displaying the sort indicators and this method also attempts to use :before. One or the other will always be broken.

Another change to make to this example is to add the CSS class myWebListBox to the CSSClasses property of the WebListBox and remove the ExecuteJavaScript line from the Opening event.

1 Like

Well, that is way over my head but thanks a lot for commenting. I just hope that Xojo engineers will be able to use this as inspiration to actually implement this feature into Xojo, this is a little and insignificant feature in a way yet in other ways it would make WebListBox more complete and put some smiles on people faces. Thanks again everybody for chiming in.

Here’s a version that uses :nth-of-type to set the background image of the column header to the icon image, but may also be nonfunctioning on your version of Safari. This allows the icon and sort indicators to coexist.

WebListBox-HeaderIcons.zip (2.4 MB)

3 Likes

Oh thanks - I didn’t know of that (it must have been introduced after Xojo 2024r1 :wink: ).

Wow - thanks a lot for looking into this more!
Great to have a working example (should someone want to use this as a workaround until it’s possible with official Xojo Web Framework maybe some time later).

…and I’ve learned a little bit more about CSS thanks to your updated example :slight_smile:

2 Likes