Weblistbox Header add a checkbox and code?

Hello all,

Is there a way to add a checkbox in the header of a weblistbox?

I would like to add that checkbox to the header so that when that box is checked code can be executed.

Any way to do this?

Thanks,
Tim

I haven’t seen posts about this on the forum.
You can open a Feature Request on Issues.

Anyone know if the <raw> functionality works in headers?

If so, adding a checkbox might be possible.

I remember @Ricardo_Cruz added this in the header some times ago.

1 Like

If that’s the case then we should be able to add a simple bootstrap checkbox and hook up an onclick event using the callback control that’s in the WebSDK examples folder.

I’m not home right now but I’ll try to remember to make an example later tonight.

Yes it works:

How did you do that Alberto? Can you please share the code?
Also, is there an event that captures when that checkbox is checked/unchecked?

Thanks,
Tim

Used the <raw> </raw> tags between them I pasted the Selected Checkbox Bootstrap sample code:

<div class="form-check">
  <input class="form-check-input" type="checkbox" value="" id="checkChecked" checked>
  <label class="form-check-label" for="checkChecked">
    Checked checkbox
  </label>
</div>

I had to remove all the end of lines because I was using the IDE just to test if the tags worked.

As this code is not part of Xojo, you need to add your event (what Greg will post later). Right now my example just change the sort direction when clicked. I don’t know how to handle the click without sorting and keep the sorting option available.

1 Like

Here ya go. Now before you run off and use this… I had to highly modify the CallbackControl from the WebSDK to get this to work. (In fact I’ll probably be including these changes in my XojoWebExtensions repo when I do my next changes). Anyway, you’ll need this version of that control to make this checkbox be able to send back the events correctly.

checkbox header sample.xojo_binary_project.zip (11.1 KB)

2 Likes

You are the MAN Greg!

Thank you!
Tim