How to sort a WebListBox?

Hello all,

Can anyone provide some sample code - or documentation - that will allow the user to sort columns in WebListBox?

Thank you!
Tim

I guess you want something besides the up/down arrows on each column.
Can you elaborate on how the user will ‘ask’ the Weblistbox to do the sort?

Hi Alberto,
No, that is exactly what I am looking for. The UP/Down arrows allow for the listbox to be sorted. But how is it done? I had it working perfectly in API 1, but cannot seem to replicate in API2

Tim

Weblistbox handle this automatically.
If you are using DataSource maybe your query is overriding the sorting.

Hi AlbertoD,

No I am not useing DataSource, the data is all there, but no arrows show up. But even after that, how do you know that the column heading has been selected?

Thanks,
Tim

How are you creating the weblistbox?
A simple WebListbox (no code) created using the IDE shows like this
image

and you can click the header a couple of times and the sort is automatic:
image

Maybe you are creating by code and need
https://documentation.xojo.com/api/user_interface/web/weblistbox.html#weblistbox-columnsorttypeat

1 Like

Got it,
Thank you! Will try it out later today,

Tim

1 Like