I have a database of things and I want to allow my users to “sort by” 1 - Creation date,
2 - Popularity (= data field number of likes ) with a dropdown element.
To do it I build 2 RGs one sort by creation date and another one sort by popularity and I play with show/hide to display the correct data.
It it working great but I am curious to know if there is a more performance oriented way of building it ?
When you are providing the data source to the repeating group. At that time you can sort data by creation date and popularity at the same time. For reference please go through the screenshot given below:
I think the main optimization is that it doesn’t need a bunch of different conditionals to sort on different fields. Not sure if it’s faster or not. If you had twenty conditionals to do this, then yes, this would make a difference.
If you are looking for speed improvements, there are other ways to improve that.
Examples,
Use TypeSense
Use a slimmed down version of your dataType for searches