• 0

Updating multiple records using image selection


I'm stuck on an issue and I'm hoping somebody will be able to help!
What I have so far:
a table named "Datasources" with a single line for each entry with 2 fields - project and datasource
Each Project can have multiple datasources, so some projects may have 20 entries or some may have only 2 or 3, so the table looks like this:
[ProjectA] [Datasource1]
[ProjectA] [Datasource2]
[ProjectA] [Datasource3]
[ProjectB] [Datasource1]
[ProjectB] [Datasource5]
[ProjectB] [Datasource8]
etc etc
What I need to do:
I would then like to set up a datapage, which is like a shop of sorts.  It will display 20 different images relating to a library of items available for selection.  These would be Datasources 1-20.
I would like this page to display all of these logos, but show visually somehow if they have already been selected by that particular project in the Datasources table.  So in the example above, when somebody from ProjectB views the table, they will see all 20 datasources, but only Datasource 1, 5 and 8 will be ticked.
They then need to be able to select new ones should they wish.  So they can click on the logos for Datasource 6, 9 and 10, and when they click the update button those 3 new entries will be passed to the Datasources table.  When they refresh the page, Datasources 1,5,6,8,9,10 are all ticked.
The issues I have are:
How can I get the datapage to search every item in the table and show a different image (i.e. one with a tick overlayed) if that particular project has already selected that datasource?  i.e. search table, IF project = ProjectA and Datasource = Datasource2 anywhere in the table, display image "datasource2-ticked".  I don't want it to just search one line of the table, but the whole table.
How can I get the page of logos to update multiple lines in the same table?
i.e. Datasource1 image = "datasource1-grey" UNLESS it has already been selected, in which case image = "datasource1-ticked".  Onclick image becomes "datasource1-colour" AND a new record is created with @Project in project column and Datasource1 in @Datasource column.
And at the same time this can be done if multiple logos are selected, a new record is created for each one.
Many thanks

Share this post

Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now