Web2 WebListbox - borderless and no alternating row color?

Try this:

Public Sub RemoveXojoBorders(Extends wlb As WebListBox)
  // To be called in the Shown event of the control (Me.RemoveXojoBorders)
  var removeClasses as string = "$('#" + wlb.ControlID + "_table').removeClass('table-striped table-bordered no-footer');"
  var borderRight as string = "$('#" + wlb.ControlID + "_table').prop(""style"").removeProperty(""border-right"");"
  var borderTop as string = "$('#" + wlb.ControlID + "_table').prop(""style"").removeProperty(""border-top"");"
  wlb.ExecuteJavaScript( removeClasses )
  wlb.ExecuteJavaScript( borderTop )
  wlb.ExecuteJavaScript( borderRight )
End Sub

They should really make customizing weblistboxes a bit easier… the output html code looks like a mess and what should be relatively fast to customize is a chore.

2 Likes

This works great Anthony!!! You are a genius.

There is a momentary flash of visible borders when the page opens which I’ll attribute to being a windows rendering problem, but I can live with that and the users probably won’t notice. It shows that even though I have the WebListbox hidden until it is populated. It probably wouldn’t fkash the borders if the framework didn’t try to draw them in the first place. I’m going to file a feature request for these items as switches in the UI along with not selectable.

Thanks Again!!!

4 Likes

Happy to help!

4 Likes

It’s truly amazing how much time people are willing to spend in order to find work-arounds for things that existed for years in Web 1. All this CSS and Javascript effort to accomplish things that should be easily done in Xojo itself… all to make Xojo web look more like a webapp. :angry:

2 Likes