Hello again. I'm embedding a dashboard in a React ...
# gooddata-ui
s
Hello again. I'm embedding a dashboard in a React app. The dashboard has 5 sections. I would like to be able to toggle the display of some of those sections according to buttons in my react application. Basically, toggle a display: none; property to some of the elements inside the embedded dashboard. I understand this is (rightly) not supported and I'm not looking for the most elegant solution. I found some informations about dashboard commands and dashboard plugins but if anyone has some pointers, it would be very helpful to me. Thanks in advance!
r
Hi again 🙂 So as you said, hiding a section of a dashboard is by default not supported, which is why the suggestions here might not be the prettiest - however: • using the Dashboard component, there may be a way to call `eagerRemoveSectionItem()`*,* stash the item under an identifier, and then
addSectionItem()
to re-add it • instead of a full Dashboard, you could use the generic InsightView component - get the list of insights from your Dashboard, map them all, and have render toggles per component • theoretically, the same might be possible with a Dashboard plugin - populate the Dashboard with your insights, and then add/remove items All that said, considering none of these are really out-of-the-box solutions, I unfortunately can't do much more than give you potential ideas, and help troubleshoot in case something isn't working as intended - but I hope this was at least a bit helpful!
s
Thanks, I will experiment with eagerRemoveSectionItem and addSectionItem, it seems to do exactly what i want. thanks for having a look!
🤞 1