I have a Gallery like that:
DataSource: colServices (a Collection, has Section Property: 1,2,3..., Request: true, false)
Toggle:
Default: ThisItem.Request
OnChange: Patch(colServices, ThisItem, Request = Toggle.Value)
OnCheck: UpdateContext({varEdit: ThisItem.Section})
OnUncheck: UpdateContext({varEdit: 0})
This variable will set the display mode of the component in the gallery.
Component.DisplayMode: If(varEdit = ThisItem.Section, Edit, View)
But Only the Last Item (Sectionm = 8 ) in Gallery has the right Effect (Please see the picture above)
The other items will set the varEdit=ThisItem.Section in a moment (0.1s), then change it to 0 after. (See the picture below)
Please explain and help me!
Hi,
You're only setting one variable to that value, so the last action to effect it will be the only one to show correctly 😺
So what's happening is that your gallery is going through and each time the toggle changes value its doing:
UpdateContext({varEdit: ThisItem.Section}) which is setting it to like 1,2,3,4,etc, and then 8, (the last one that is OnChecked)
and then its checking
If(varEdit = ThisItem.Section, Edit, View)
for each of your items, but varEdit is 8 now, so none of the others will be in edit mode as 8 = 8 is the only true value
So what I would do instead is set your component DisplayMode as:
If(Toggle1.Value=true, Edit, View)
- this will be evaluated individually in gallery rows so should Edit the ones that are checked only.
Could you give that a try and let me know whether it worked for you?
Thanks,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
User | Count |
---|---|
224 | |
99 | |
95 | |
57 | |
31 |
User | Count |
---|---|
283 | |
113 | |
107 | |
63 | |
61 |