01-20-2018 09:45 AM
How to expand and collapse a nested gallery / sub-gallery. Following on from my video on creating nested galleries here is a demo of how you can set your sub-galleries to expand or collapse when you click on the parent gallery. Two methods are shown, one allowing you to expand a single sub-gallery at a time and one allowing you to expand/collapse whichever sub-galleries you choose.
The second option makes use of a collection and the functions Collect, Remove, CountRows and IF.
watch?v=VNnaymeBN7g
Hello and thank you for the share.
Is there a limitation in the number of items. I use your solution for my own need and I face up an issue while drilling down the upper list (groupedItems)
- in dev mode : it crashes ("WebAuthoring abnormal termination.") / see error message detailed below
- In production there is no error message but the list of grouped items is not very well displayed after some lines
Detailed error massage :
WebAuthoring abnormal termination.
Client date/time: 2018-01-20T17:27:06.441Z
Version: 2.0.750 (v2.0.750.64884645)
Session ID: f3d37a67-df0a-46f6-8193-90e138358b4b
description: {"error":{"isTrusted":true,"detail":{"exception":{}},"message":"Uncaught TypeError: Cannot read property 'style' of null","filename":"https://cdn-paaprodweu.azureedge.net/v2.0.750.64884645/studio/ctrllib/gallery/js/gallery.js?v=2.0.75... TypeError: Cannot read property 'style' of null","setPromise":"[function]","exception":{}}
stack: null
errorNumber: 0
errorMessage: Uncaught TypeError: Cannot read property 'style' of null
Hi @Lionel
Yes, there appears to be a bug in the designer which means that it will often crash when using the Gallery/Subgallery approach with a larger dataset. For development/testing, try to work with a small dataset to prevent this.
If text wraps over several lines then it may not display well (remember we count the number of records and then multiply by a line height - so if the line height changes or the text doesn't fit on a line it doesn't look great). Assuming the records fit on single lines I've found it *mostly* looks OK, though I have seen the occasional 'glitch' especially in the Web viewer and on Windows Mobile. iOS and Android seem to suffer less from display issues in my experience.
Hi @Lionel
You only need to reduce your dataset for development purposes. I just use a Filter or a FirstN (https://docs.microsoft.com/en-us/powerapps/functions/function-first-last) on the gallery's item property to ensure I am working with a dataset small enough that it won't crash the web designer. When finished designing, remove the Filter or FirstN and Publish.
Hope that helps
Paul
Thank you @PaulD1. I was able to workaround the dev issue. Major bug was in production: list is misdisplayed after the first screen (some lacks). I tested on web chrome, poweraps IOS and android with the same results.
I choose to presenting data in another way 🙂