I am currently building an application that has a parent and a child gallery with an expand/collapse behavior. I have successfully achieved that functionality, However i am facing an issue.
I would want the collapse and expand to happen on the up and down icons within the parent gallery. However, if i select any other input like a toggle or a text field or even a dropdown the Child gallery is visible, i noticed that issue was there because the parent gallery selectable property was true. when i turned it off the accordion functionality stopped working.
What i would want is to only show child gallery on up and down arrow and not on all the inputs within the parent gallery.
How can i solve this issue?
Can't give you definitive help because you should include the code on the properties you have for the arrow.
Generally, assuming that you are setting the visibility for the dropdown on your button icon, you need to include 'ThisItem.Submenu' afterward so it only shows the Submenu for the current item. I.E.
Visible: Set(showsubmenu, !showsubmenu); ThisItem.Submenu [or whatever you've called the SubMenu in the table you've created to store the menu info]
@illmatic_one I have included the code on the arrow only. Here is the image below. These are nested galleries. The Additional Information shows up even if i click on on any other element of the parent gallery which i do not want.
The problem is not all parent gallery items will have child items. Some have and some do not. So even if the parent gallery item does not have child item , if i click on any parent gallery element it shows up the child gallery which should not be the case.
Any help in this?
hey there.. I mean you need to show what you have on the Items property and how you actually designed the app, which formulas you are using. A picture of the app itself doesn't really help us help you much. Also, I don't see the code for the arrow included here either? Just the picture of the arrow.
What is the Visible property of your submenu? You could try adding 'ThisItem.IsSelected' to the Visible property and whatever variable you are using to toggle visibility in the OnSelect of the arrow. For instance, if your OnSelect property on the arrow is Set(showMenu, !showMenu), then on the Visible property of the submenu you'd write 'ThisItem.IsSelected' && showMenu. This will only show the submenu that is currently selected and only when your variable is set to true.
For showing the arrows only if there is a child submenu property, you need to change the Visible property of the arrows. You could do so by using the Blank function. Something like: !IsBlank(ThisItem.ChildMenu). Depending on how you've structured your table, this will only show the arrow if the ChildMenu property isn't blank. AKA If you have a child menu, it will show the arrow but if not the arrow will be hidden.
@illmatic_one thank you for your suggestions, but i am still facing an issue. Let me show you some screenshots.
I have updated the down arrow onselect property to
Select(Parent);Set(showmenu,!showmenu); ClearCollect(coladditionalquestions,Filter('Question Master',Title = ThisItem.Title))
Updated the up arrow on select property to
Even when the arrow is not present if i click on a gallery item that does not have arrow it still opens up the child gallery, that is due to parent gallery selectable property which is set to true. Can you help me fix this issue?
Please find the gif below
Select the gallery itself, does it have anything on its own OnSelect property? I notice both of your arrows have Select(Parent); if you have that expand/collapse function on the gallery itself, those arrows will select their parent (the gallery), thus triggering the expand/collapse regardless if an arrow was clicked or not.
Thank you for highlighting that, I removed the select(parent) code and it is now not showing the child gallery. However, if i click on an item that is of that parent gallery which has child items, then the arrow UP changes to Arrow down. But i do not need to change the arrow when i click on any other element of the parent gallery other than the arrow. i do not have any code on the on change or on select property of the elements. Please find example below. I have the below on code on down arrow visible property
And(!ThisItem.IsSelected,CountRows(Filter('Question Master',Title = ThisItem.Title))>0)
On select has below code
Set(showmenu,true); ClearCollect(coladditionalquestions,Filter('Question Master',Title = ThisItem.Title))
Up arrow has below code on visible
And(ThisItem.IsSelected,CountRows(Filter('Question Master',Title = ThisItem.Title))>0)
On select has below code:
Below is the image for the issue arising now:
Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.
Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.
The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.
We are excited to announce a new way to share your ideas for Power Apps!