Looks like Matt beat me to the punch on this one - Conditional Rendering of menu items would eliminate a lot of custom code that we currently have written to manage our menu system.
This looks implemented but I see empty spaces where those items “would be”. I have different rep types and render a group of Nav Items for 1 and a different one for the other. The nav bar breaks up or has empty spaces when logged in as someone with sections not meeting render criteria.
This reply was created from a merged topic originally titled unrendered nav component items cause wrapping/css problems. I thought I saw another thread about this a while ago, but I couldn’t find it again. Sorry if this is a repeat.
Thanks Matt! I just wrote something for this yesterday, although mine was much less efficient. I used an $.each loop and ‘this.getAttribute(“data-rendered”) == “false”’.
Matt/Craig - In general, removing DOM elements that Skuid adds could lead to undesired behavior in some situations. In this case, you should be OK since it’s a DOM element inside of the component itself. With that said, rather than use Javascript for this, you should be able to accomplish the workaround with pure CSS. Try one of the following: 1) To hide all empty DIVs with any navigation component .sk-navigation div:empty { display:none; } 2) To hide all empty DIVs within a specific navigation component (Specify a unique Id on your Nav component - in this case its called myNav) #myNav div:empty { display: none; }
Thanks for the information Barry. My JS snippet actually added a CSS class that has display:none in it. A much less eloquent solution than yours - but it did the job 🙂
This issue has been incorporated into Rockaway Iteration 13 and is now available from the Skuid Releases page at http://www.skuid.com/skuidreleases. As a reminder, Salesforce does not allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment.
Thank you for your patience while we worked to implement this.