All good @boston85719. I appreciate the effort you’ve put in with this, and yes, about to head down the path of duplicating data similar to what you’ve suggested
https://buildingonbubble.com/block/sort-both-ways-1571396940102x150318552013078530
This should do the trick for you.
It it easiest if you have a list on the “parent” - so in your case an Owner has a List of Properties.
So you would search for a list of Owners, sorted by name, and output the list of Properties.
You can do it the hard way, and for each sorted Owner go and look for Properties that have this Owner.
@NigelG
Hi Nigel,
Have been reading up on this sorting business in the forum, and checked your demo app.
In my case I have a table Gig having field Status which is a link to the table Gig_Status. This to make the statuses dynamic and editable by the sysadmin.
So going with your thinking I should turn it around and instead give the Gig_Status a list of Gig and push the Gig_Status list of Gig to the Repeating group. Correct?
But, I have a lot of filter options for the user. Gig_Status is one of them (apart from being the sort criteria) together with many others that relate directly to Gig fields, and even other tables linked to Gig. In your expert opinion, will it be possible to do the sorting “your way” and be possible to apply the filtering?
Thanks for any thoughts,
Peter
@philledille, I am trying to solve the same problem, and I believe that @NigelG’s solution will not work for us for the following reason:
NigelG’s solution requires that the child field is the field to sort on. In our cases, we need fields within the child thing to be the sort.
My case is this:
Parent: Sports Games, including total fans watched and average rating
Child: UserGame which holds the user’s rating of the game (amongst many other fields).
I want to be able to sort the RG on all 3 of:
- Game’s count of fans watched
- Game’s average rating
- UserGame rating
Yes, but I would be also be looking at maybe converting your “Gig_status” table into an Option set and using that.
As long as User Game has the Parent on it, then you can have an RG of type Game and Search for UserGame’s sorted by Rating.Game
But I think what you really mean is how to sort on the average rating ?
@SerPounce Could this help you out:
// Peter
Sorry, I said that Gig_Status should be editable by sysadmin. I meant a normal admin without access to Bubble. So, I have to stick with a table.
Thank you for the response @NigelG. I aim to search on all those fields: Games average rating, Games count of users rated and UserGames rating.
The use case is like IMDB. Instead of sorting on movies, this is sports games and I am looking to provide the feature set for the user to sort on how many watched, their average rating, as well as my personal rating.
That’s a real nifty possible direction, thank you @philledille. But I believe that the base RG must be off the UserGames thing for 2 reasons:
- I need to also sort on the UserGames rating (the current user’s personal rating).
- I provide a feature for the user to enter their ratings directly in the RG via a reusable element that interacts with the UserGames thing:
Nice UI ! Could a possible course of action be to have separate RGs for each sort?
Yes, slightly harder. Also, I have another dimension that I will sort on, in combination with the above.
First sort: Is the Gig created after the users last visit. Second sort: Gig_Status.
Is this even possible?
hmmm. Another interesting path. But as I consider that one, the RG with the parent (Games) would make it difficult for my reusable that needs direct access to the child thing. I could do a search for within the RG cell for current Game and User, but I imagine that would be really adverse for performance.
My least-of-all-the-evils workaround currently is to replicate the 2 relevant pieces of parent data within every child. It works, but is hyper annoying that we can’t just sort easily at both levels.
Thanks again for your efforts and feedback @philledille to collaborate.
This topic was automatically closed after 70 days. New replies are no longer allowed.