descending( )

Adds a sort to a query or sort, sorting by the specified properties in descending order.

The descending() function refines a WixDataQuery or WixDataSort to sort in descending order of the specified properties. If you specify more than one property, descending() sorts the results in descending order by each property in the order they are listed.

You can sort the following types:

  • Number: Sorts numerically.
  • Date: Sorts by date and time.
  • String: Sorts lexicographically, so "abc" comes before "XYZ".
  • Reference: Compares by the ID of the referenced item as a String.

If a property contains a number as a String, that value will be sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest.

Method Declaration
Method Parameters

The properties used in the sort.

Was this helpful?