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

How to highlight the selection on gallery

Hi,

 

I have  a gallery and it is set to a collection Alerts. There  is a dropdown that has different sort option applied on the gallery.

I have selected sort option 1 and selected second item in the gallery that opens further details of the selected item.

Now I change the sort option 2 and obviously the gallery list order changes with this the second item which I selected in the gallery also changes and that renders the new positioned second item's details and not the prior user selected item.

 

Requirement :

Even when user selects multiple options in sort drop down and the collection items gets repositioned , it should not change the details of the original selected item. The left side gallery should scroll to the original selected item where ever its repositioned in the gallery.

 

Any idea how this can be done? Thanks in advance.

 

I could manage until the details view doesnt get chnaged with sort order but the gallery is not getting scrolled to the repositioned selected object id.

 

 

 

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @RoopaPendyala,

 

Sorry but I cannot fully understand what you are trying to describe, would you please share some screenshots of your app? Also, please post the related formulas that you have used in the gallery.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

Yes, Mona is right, it always helps if you have the related formula and some screenshoots. 🙂

Nevertheless if I understood correctly, you can try this..
You have a gallery that displays the items --> Gallery1
Gallery1 has a source ---> Expression1
You use a dropdown to sort the gallery --> Dropdown1

Try to do the following and check if it is working.
Dropdown1.OnChange = UpdateContext({vReset:true});UpdateContext({vReset:false})
Gallery1.Items = If(!vReset,Expression1)


In an example that I have created Expression1 = Switch(Dropdown1.Selected.Value,"1",Sort(A,ID),"2",Sort(A,text))
So it needs to change to:
Gallery1.Items = If(!vReset,Switch(Dropdown1.Selected.Value,"1",Sort(A,ID),"2",Sort(A,text)))

Edit: I assume that you have set the Default value in the Gallery1.
If not, please share the related expressions and we can find a way.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (81,265)