setSort( )


Sets the dataset sort order.

The setSort function sorts the items in the dataset.

The WixDataSort object is created by calling the sort() function on wixData and chaining one or more of the following WixDataSort sort functions.

Setting a dataset's sort overrides existing sorts that were previously set using the setSort() function or using the Dataset Settings panel in the Editor.

To clear a dataset's current sort, call setSort() and pass it an empty sort. You create an empty sort by calling the sort() function without chaining any of the additional sort functions mentioned above.

Calling setSort() on a write-only dataset causes an error.

You will need to import wix-data to create a WixDataSort object.

Note: When using a read-write dataset and linked input elements, calling any of the following functions will save any changes made in the linked input elements.

Method Declaration
Copy
Method Parameters
sortWixDataSortRequired

A wix-data sort object.

Did this help?