cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver I
Resolver I

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
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
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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (34,608)