Hiding the Widgets' toollbars
Usually when embedding an entire dashboard, you may want to remove the widget's (hover-on) toolbar, so the end users will be able to see additional information or to export to CSV
Note - When embedding a single widget, the toolbar is hidden by default.
Using Java Script:
- Edit the dashboard script
- Paste the following code:
dashboard.on('refreshend', function(se, ev){ if (prism.user.roles.consumer)
{
$('widget-header, .menu-btn').css('display','none');
} })
3. Click Save and hard-refresh your embedded dashboard (http:///.......dashboardID?embed=true)
4. If you are logged to the system as a Consumer, the tiny toolbars will not be shown.
** Version 6.4 and above change the if statement to
(prism.user.roleName == 'consumer')
-
Thanks for the quick response! That works for disabling the menu, but it doesn't actually hide the toolbar and it doesn't disable the "full screen" option. I'm attaching what I'm seeing by the end user (not in the designer). I really want to remove that whole title bar space so that widgets line up.
tabber.png -
Hi,
Add this script remove the Title Bar on a widget level
Edit Widget > Options > Edit Script
widget.on('ready', function(se, ev){
if (prism.user.roleName == 'consumer'){$('widget-header, .menu-btn').hide();
}});To remove only the options buttons
widget.on('ready', function(se, ev){
if (prism.user.roleName == 'consumer'){
$('widget-header, .menu-btn').children('widget-toolbar').css('display','none');
}}); -
Some odd things are happening when I try to hide a widget's title bar--the title bar for an unrelated widget disappears instead. At no point does either widget interact with the other. The one I want to disappear is a simple indicator and the one that is disappearing instead is a Tabber for two sets of three other widgets.
Also, my limited understanding suggests that the following line is intended to have the title exist while in editing mode.
if (prism.user.roleName == 'consumer'){
If this is the case, then another oddity is that the Tabber title is disappearing in editing mode despite this check.
Should switching to "View Mode" while in the editor trigger this role change?
Thanks in advance for any assistance
-
Hi Andy,
This code will hide that button at an individual widget level from viewer and designer users. Tested in 7.1.
widget.on('ready', function(se, ev) {
if (prism.user.roleName == 'contributor' || prism.user.roleName == 'consumer') {
$('span.btn__icon.app-icon.app-icon--general-expand').css('display', 'none');
}
}); -
Is there anything we have to do differently in 8.0 and 8.1? The dashboard script does not work.
However, applying the widget script to one widget affects every widget on a dashboard:
widget.on('ready', function(se, ev){
if (prism.user.roleName == 'consumer'){
$('widget-header, .menu-btn').hide();
}});
Please sign in to leave a comment.
Comments
13 comments