I have a dynamic list of resources clients can choose from on an insert form called Service, they are displayed as checkboxes in this case. The list is generated from a resource table.
The Service page inserts date into a service table but inserts the resources selected into a resource-used table. This table used the service table ID as the join.
I have create a test page to show the selected resources-used items, again using checkboxes. I followed a post by Teodor on How to create Dynamic Checkboxes.
In the image below you can see the results for a test service record. The top list in a straight forward repeat of all resources available, the lower list shows the resources selected during the insert stage of the service record.
The repeat scservice.data.query is a database query consisting of;
service table, joined to the resources-used table by the service-id and the resources table joined by the resource-id in order to get the resource name. (I can show this in more detail is nessary)
My question is;
How do I get the resources-used list to also include the resources not selected so that a client can later select them?
Do you mean you actually want to display ALL of the possible resources stored in the resources table ONLY that each of them will display on this page with an associated checkbox that shows either a Checked status or, if unselected, the open un-checked checkbox?
So that the user still sees ALL available resources from that resources table.
As in your example the lists will be sorted, perhaps sequentially showing Checked Resources then Unchecked Resources that can still be added – clicked on. So that the User is actually eligible to EDIT their previous form session.
So that the Un-checked values can still be checked, too, or even if the User wants to De-select a checked value as needed before RE-Save/Submit of the form ?
Yes, that’s exactly what I’m trying to achieve but I can’t figure out how to show the unselected resources using the query above, I somehow need to include them in the result.
I did that some time ago on an admin panel of an accommodation site. It was quite a complex process if I recall but I probably have the code archived, will check when back in office.
I have a code too. Don’t remember exactly
I will check it out later.
Something like having another query where the condition is query2.id = query1.id.
On the ac, the repeats expression is binded to query2.
The checked status == 1.
Something like that.
I’ll have the computer in about 8 hours since I’m work.
I must repeat “I think I understand” as I’m from a country where english is not the current language
So:
This can work? I changed the names for a better reading, in my case “services” are like “options” or “amenities”
DATABASE
Table of appointments
Table of services
Data (related is the appointment id, and service_id, well…)
SERVER SIDE
Query of Appointment where appointment.id = {{$_GET.id}}
Query of Service
Query of Data where “related” is = appointment.id and a join (with “services” table) where id_service (from table services) = dataservices.service_id (from table dataservices)
CLIENT SIDE
Query where I create my id parameter
Server connect where I have linked $_GET.id to my query.id
The “Repeat step” is from the serverconnect1.queryData
The checkbox is “checked” as the value (in dynamic atribute) has the condition “field == 1”)
So:
I hope this is what you’re talking about, otherwise I’ll be very embarassed and I’ll take english lesson asap.