Page 3 of 3

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

Posted: Fri Jan 10, 2014 8:20 am
by Gabriel Bizcarra

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?


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

Posted: Fri Jan 10, 2014 1:01 pm
by Kateryna Grynko

Gabriel,

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


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

Posted: Fri Jan 10, 2014 3:43 pm
by Gabriel Bizcarra

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.


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

Posted: Fri Jan 10, 2014 3:56 pm
by Gabriel Bizcarra

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?


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

Posted: Fri Jan 10, 2014 6:25 pm
by Maryna Brodina

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.


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

Posted: Sat Jan 11, 2014 3:54 am
by Gabriel Bizcarra

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.