Sisense Community logo
    • Community Feedback
    • Chapters
    • Events
    • Forums
      • Help and How To
      • Product Feedback Forum
      • Strategy & Use Cases
    • Blogs
    • KB Docs
      • KB Docs
      • Add-Ons & Plug-Ins
      • APIs
      • Best Practices
      • Blox
      • CDT
      • Cloud Managed Service
      • Data Models
      • Data Sources
      • Embedding Analytics
      • How-Tos & FAQs
      • Onboarding
      • PySisense
      • Security
      • Sisense Administration
      • Sisense Intelligence & AI
      • Troubleshooting
      • Widget & Dashboard Scripts
    • Support
    • Learning
      • Sisense Academy: Free Courses and Certifications
      • Official Developer Documentation
      • Official Product Documentation
      • Official Sisense Youtube Channel
      • Sisense Compose SDK Playground
      • Official Sisense Discord
    • Use Case Gallery
    Discussions
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Discussions
    • TagsChevronRightIcon
    hide buttons
      • Widget & Dashboard ScriptsChevronRightIcon

      Selectively Hide Widget Toolbar Buttons

                               

      Selectively Hide Widget Toolbar Buttons The widget script below shows a list of buttons that are available on a widget toolbar and how to hide each of them, so you can choose which ones you want to hide for any particular widget. Note that if you hide the Edit button, as the owner of the dashboard, the only way for you to open and edit the widget is to have the direct URL to the widget. If you want to hide the button(s) only for viewers (so you can still see all the buttons as the owner/designer), uncomment the code that checks the user's role (see comments in the code below).   /** This is the widget script to selectively hide widget toolbar buttons **/ //Hide widget toolbar options widget.on('buildquery', ()=> { //Uncomment the code below if you want to hide the buttons only for viewers //if(prism.user.roleName == 'consumer') { //Hide Edit (pencil) button $(element).parent().find('.widget-toolbar-btn--edit').remove(); //Hide Expand / Full Screen (diagonal double-headed arrow) button $(element).parent().find('.widget-toolbar-btn--fullscreen').remove(); //Hide Detail (circled i) button $(element).parent().find('.btn--no-background').remove(); //Hide Menu (vertical ellipsis) button $(element).parent().find('.widget-toolbar-btn--menu').remove(); //Hide Analyze It (graduation owl) button $(element).parent().find('.analyze-it-button').remove(); //Uncomment the closing curly bracket below if you want to hide the buttons only for viewers //} })  

      Tri Anthony
      Tri AnthonyPosted 2 years ago • Last reply 1 year ago
      3