Gabriel Bizcarra
Posts: 0
Joined: Sun Dec 22, 2013 1:02 am

How do I make an image visible/not visible for each record in a list based on a second collection?

Oh I didn't explain, it's strange to me because you could potentially have thousands of users. Seems strange to keep thousands of entries in an array field. Is it even possible?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How do I make an image visible/not visible for each record in a list based on a second collection?

Gabriel,

How many events do you plan to store, thousands?
Probably it's easier to store a list event for a user.

Gabriel Bizcarra
Posts: 0
Joined: Sun Dec 22, 2013 1:02 am

How do I make an image visible/not visible for each record in a list based on a second collection?

sorry I don't understand. If I store the events that a user is going to in the user collection, how will that allow me to get the result set I'm after?

Event 1, User 1
Event 2, null (or blank)
Event 3, null (or blank)

This has further implications. I also want to have a partner search functionality where I'll want to show a list of people who a looking for partners for specific events. It's starts to get a little unwieldy managing all permutations in arrays. And the fundamental question still hasn't been answered.

Am I able to get this result either by using different collections as I have, or by using arrays that might have thousands of users in the events collection. If I add the event to the user can I show all events, even those that the user is not going to?

These are all fairly fundamental types of applications, I'm perplexed that it's so difficult to answer. Is there an example of a dating site I could reference? That would have to use similar functionality to what I'm asking for.

I appreciate your help.

Cheers,

Gabriel.

Gabriel Bizcarra
Posts: 0
Joined: Sun Dec 22, 2013 1:02 am

How do I make an image visible/not visible for each record in a list based on a second collection?

Perhaps I can do this in code? Can I query collections in code to construct my results and map them in the panel programatically rather than using services to map?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How do I make an image visible/not visible for each record in a list based on a second collection?

Hello! You have to use 2 services - for collection colAttend to get all records with UserN and service to get all events from colEvents collection.
1) Do request to colAttend collection to get all records with UserN. On service success event save all events you have in response in array. After saving events array on service success event invoke another service to get all events.
2) In mapping of service you use to get all events add JS in mapping to "ticked" picture. In JS check is there event in array user is going to and show/don't show picture.

Gabriel Bizcarra
Posts: 0
Joined: Sun Dec 22, 2013 1:02 am

How do I make an image visible/not visible for each record in a list based on a second collection?

hey this sounds like a solution! Progress.. I'll give it a go tonight and let you know how i go.

Thank you for your patience.

Return to “Issues”