-
-
Save taylor8294/218bb2fca75c89064b8575f7c9f0352b to your computer and use it in GitHub Desktop.
| // Enable badges in menu items | |
| .ui-panelmenu-header, .ui-menuitem { | |
| position: relative; | |
| } | |
| .ui-menuitem-text .badge{ | |
| position: absolute; | |
| right: 1.5em; | |
| top: 1.4em; | |
| top: calc(0.714em + 7px); | |
| } |
This was written to work with PrimeNG 7.0.5 early last year, if this hack is still needed and hasn’t been made into a standard feature of the library yet, it sounds like it will need tweaking to work with latest versions. Off the top of my head, try changing el.nextSibling.appendChild at the bottom of the component to just el.appendChild, see if that fixes you’re problem.
Yes.. el.appendChild works.
Thank you :)
It seams PrimeNG adds a neat way to do it. But even when I set badge and badgeStyleClass to the menu item's model, nothing happen! Is there anyone who used this feature?
I am having the same problem, and paid for premium "designer", the documentation is lacking with numerous components... Don't reference the menuModel if you can't actually use all the options with it... be explicit.
When I tried this solution. I am getting this error.
ERROR DOMException: Failed to execute 'appendChild' on 'Node': This node type does not support this method.