cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrQ
Helper V
Helper V

Floating Menu in a gallery?

Hey there

 

I was wondering if anyone achieved a floating menu in a gallery? To visualize what I mean, here's a pic:

gallery-floating-menu.png

Credits 

 

I couldn't figure out to get the exact position of the selected item relative to the screen size yet.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @mrQ :

Do you want to add a floating menu to a gallery?

you can achieve this function through the Visible property.

Ive 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 Group1s 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 arrows 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

View solution in original post

4 REPLIES 4
v-bofeng-msft
Community Support
Community Support

Hi @mrQ :

Do you want to add a floating menu to a gallery?

you can achieve this function through the Visible property.

Ive 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 Group1s 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 arrows 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

View solution in original post

Hey @v-bofeng-msft 

 

Thanks for your reply.

Unfortunately, this is not really what I was looking due to the following reasons:

 

  • The floating menu shouldn't need to be loaded for every single item in a gallery. This is causing performance issues automatically
  • The floating menu's height should be bigger than the TemplateSize of the gallery item. If you have galleries with very little space / height, a floating menu will not have space at all
v-bofeng-msft
Community Support
Community Support

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.

a.jpgb.jpgc.PNG

Best Regards,

Bof

 

@v-bofeng-msft 

 

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
)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,008)