Hey there
I was wondering if anyone achieved a floating menu in a gallery? To visualize what I mean, here's a pic:
I couldn't figure out to get the exact position of the selected item relative to the screen size yet.
Solved! Go to Solution.
Hi @mrQ :
Do you want to add a floating menu to a gallery?
you can achieve this function through the Visible property.
I’ve made a test for your reference:
1\Add some controls in to the gallery(Gallery4).
2\Group these controls in to a new group(Group1)
3\Set Group1’s Visible property to:
If(
Visible, /*a custom variable, I will define it later*/
If( /* If the item is selected, the menu will be displayed*/
Gallery4.Selected.ID = ThisItem.ID, /* ID is the primary key of the data source of my gallery, you can use your primary key instead*/
true,
false
),
false
)
4\Set the arrow’s OnSelect property to:
Select(Parent);UpdateContext({Visible:!Visible}) /* Visible is my custom variable */
5\ Adjust the data card in the gallery to the size you need.
Best Regards,
Bof
Hi @mrQ :
Do you want to add a floating menu to a gallery?
you can achieve this function through the Visible property.
I’ve made a test for your reference:
1\Add some controls in to the gallery(Gallery4).
2\Group these controls in to a new group(Group1)
3\Set Group1’s Visible property to:
If(
Visible, /*a custom variable, I will define it later*/
If( /* If the item is selected, the menu will be displayed*/
Gallery4.Selected.ID = ThisItem.ID, /* ID is the primary key of the data source of my gallery, you can use your primary key instead*/
true,
false
),
false
)
4\Set the arrow’s OnSelect property to:
Select(Parent);UpdateContext({Visible:!Visible}) /* Visible is my custom variable */
5\ Adjust the data card in the gallery to the size you need.
Best Regards,
Bof
Hey @v-bofeng-msft
Thanks for your reply.
Unfortunately, this is not really what I was looking due to the following reasons:
Hi @mrQ :
About Q1:The floating menu shouldn't need to be loaded for every single item in a gallery.
The floating menu will not be loaded for every single item in a gallery.(I attached the picture)
About Q2:The floating menu's height should be bigger than the TemplateSize of the gallery item.
You can enlarge the template size of the gallery project first, and then reduce the template size of the gallery project after setting the menu.
Best Regards,
Bof
Thanks for that. To adjust the gallery item's height temporarily to make the group inside bigger is a pretty neat trick I didn't know. Works great and my problem is solved. Thank you!
What I meant with "The floating menu shouldn't need to be loaded for every single item in a gallery" is as I'm always trying to improve the performance of the app. If I place a menu inside a gallery item, it will be loaded for every item in that gallery. It's just hidden until I click on that button. But if my gallery contains 200 items, the group will be loaded 200 times. At least that's my assumption. Can you confirm that, as it's just a theory of mine...
Ps.
Slight improvements on your formula/code:
If(
Visible, /*a custom variable, I will define it later*/
If( /* If the item is selected, the menu will be displayed*/
ThisItem.IsSelected, /* If current item is selected */
true,
false
),
false
)
User | Count |
---|---|
183 | |
123 | |
88 | |
45 | |
42 |
User | Count |
---|---|
250 | |
160 | |
126 | |
78 | |
73 |