Expression picker doesn't display under Condition column in Sorting

Under Sorting, what is the usage of the Condition column? Clicking the expression icon does nothing. Adding a value does not change in the SQL preview.

database-sorting

This is a very useful feature. Eg if you want to include options like this, sending GET parameters and using them in the conditions:

image

Thanks for clarifying. Then it is a bug that clicking on the bind icon does nothing.

I hadn’t noticed that, but yes, it seems to be a bug (I’m using 3.7.8). You can still paste into the condition field, so it’s useable.

Hi @TomD, can you share a bit about how you got the “Sort by” to work in the above screenshot? I was trying to figure it out and hadn’t thought about using conditions under the sorting tab. And then how does that relate to the page code? Cheers

Hi @UKRiggers - here are some details.

In this example, selecting a sort option updates a query parameter and stores the choice in a cookie:

<select class="custom-select d-block w-100" id="sortorder" name="sortorder" dmx-bind:value="query.sort" dmx-on:updated="qm1.set('sort',value);cookies1.set('sortorder',value,{})" aria-label="sort order">
(edit: code simplified - not necessary to include a load action)

In query builder, there is list of sort options and conditions. For ASC/DESC, you’ll need a sort option for each. Similarly, you can create multi-criteria sorts with multiple conditions - that’s why I’ve used the same condition twice (but perhaps there are other methods):

image

1 Like

Nice one @TomD, it makes sense when you see it visually :framed_picture:
Cheers.

This has been fixed in Wappler 3.8.2

This topic was automatically closed after 45 hours. New replies are no longer allowed.