The Tabber Widget Switcher Plugin
*This plugin is officially supported by Sisense. You can find the latest version of this plugin on the Sisense Add-Ons page.
Introduction
The Tabber Plugin creates a new widget that allows the user to switch between views easily and quickly without changing the dashboard.
Please note this widget is designed to be used only once per dashboard. It also does not yet support saving the tabber state after refreshes or filter changes.
Example
Tabber Widget can be used to view data in different time zone (Current Month , Last Month) or to view data in different categories (Revenues, Sales,Orders ).
Also, the Tabber can be used to view the same data in different ways (chart, numeric, table).
You can add many Tabber names as long it fits in the same row.
Also, you can add more than one Tabber Widget in the same Dashboard if necessary.
Steps
A Tabber widget can be added to all Dashboards and can be used with all widgets.
In order to add a Tabber widget, please follow the listed steps below:
Step 1:
Download and extract the enclosed folder into the plugins folder:
C:\Program Files\Sisense\PrismWeb\plugins\WidgetsTabber, if the "plugins" folder is not there, please create it
Step 2:
Create a new Tabber Widget - Press Choose
and choose TABBER:
click apply to create the widget
Step 3:
Open the Tabber widget editor, edit script.
Copy the js code below into the script editor.
widget.on('render',function(w, e) {
e.prefixText = ''; e.suffixText = '';
e.selectedColor = '#86b817'; /*The color of the chosen title*/
e.fontColor = '#cccccc'; /*The color of the unchosen titles*/ e.elementWidth = '103%'; e.descColor = '#a5a5a5'; e.parentMarginLeft = '-15px'; e.height = 32; /* affects the tabber widget default high*/ });
widget.tabs = [
{
title: "Column Chart",
displayWidgetIds : ["55797a9459ef031011000032"],
hideWidgetIds : ["557d408a4630ccdc11000019"]
},
{
title: "Table",
displayWidgetIds : ["557d408a4630ccdc11000019"],
hideWidgetIds : ["55797a9459ef031011000032"]
}
];
Code configuration:
Each row represents a different tab. The order of the tabs is according to the rows as the appear in the code.
displayWidgetIds: In the [] write all the widgets ID's you with to display under the specific tab in “”, seperated by comma.
hideWidgetIds: In the [] write all the widgets ID's you with to hide from the specific tab in “”, seperated by comma.
- The widget ID appear in the widget url: Go to Edit Widget and copy the widget ID from the end of the widget url address- for example: http://localhost:8081/app/main#/dashboards/55797a3542f03101100002c/widgets/55797a9459ef031011000032
- The widget number is: 55797a9459ef031011000032
- In order to change the Tabber design - see design definition in the code (explanations are documented in the code).
- Press SAVE
- Close the Script window
- Refresh the widget and click apply
- The chart should appear with the Tabber widget and configuration.
Step 4:
Edit dashboard script to define hidden widgets.
Copy the js code below into the script editor.
dashboard.hideWidgetIds = ["556eb860106eb3f42100002f","556c26f88a6b1c68290000f8"];
hideWidgetIds: In the [] list ALL hidden widgets for ALL tabs in the Tabber between “”, seperated by comma
Step 5 Multiple widgets
To place multiple widgets under one tab,please copy the js code below into the script editor:
widget.tabsConfig = 'multiply'
Example:
Place two widgets on top of others:
Copy the js code below into the script editor: (do not forget to change widget ids)
widget.on('render',function(w, e){e.prefixText = '';
e.suffixText = '';
e.selectedColor = '#86b817'; /*The color of the chosen title*/
e.fontColor = '#cccccc'; /*The color of the unchosen titles*/
e.elementWidth = '103%';
e.descColor = '#a5a5a5';
e.parentMarginLeft = '-15px';
e.height = 32; /* affects the tabber widget default high*/
});
widget.tabs = [{title: "TAB 1 ", displayWidgetIds : ["57613637b2ea62dc36000004","57613637b2ea62dc36000006"], hideWidgetIds : ["57613637b2ea62dc36000007","57613637b2ea62dc36000005"]},
{title: "TAB 2", displayWidgetIds : ["57613637b2ea62dc36000007","57613637b2ea62dc36000005"], hideWidgetIds : ["57613637b2ea62dc36000004","57613637b2ea62dc36000006"]}
];
widget.tabsConfig = 'multiply';
Result:
03/09/2016 update:
Fixed column resizer issue
Added config to create multiple widgets in one row for one tab: (Add widget.tabsConfig = 'multiply' to widget edit script)
10/06/2015 update:
- New implementation of the tabber.
- Several assumptions that needed to take under consideration:
- Widgets and tabber are divided to 2 different rows per column.
- Each row contains only tabber/ tabbed widgets.
- The # of widgets that will be shown at the same time is equal to the number of tabbers in the row above (so, not capable of toggling 2 widgets from the same tabber).
-
Hi Jim,
Confirming, are you placing two widgets side by side and then hiding one of them, causing the other to expand?
If so, have you tried stacking the two widgets instead? That way they're full-width on PDF export (though, again, the hiding function of the tabber is moot at that point).
-
Huanan & Kara -
I was having the same problem. I was using "prism.activeDashboard.widgets.toArray()" via the console to grab widget IDs. If you are doing something similar, make sure you're using the "oid" within that array rather than the first "_id" shown. This solved my issue.
Additionally, if you copy/paste the following from the first page, the script will not show an error and ignore everything. Something with the way the quotations are formatted around the "multiply" causes an issue.
widget.tabsConfig = 'multiply';
-
@Huang,
You can add "old school" on.click listeners to the tab's buttons.
Ping me if you need assistance
-
I'm also having the issue where the tooltip text is showing up in the tabber, which is kind of bizarre. We're on version 7.1.3 and seeing this with the latest tabber version.
I will add that the PDF export behavior for tabber is frustrating when it shows all widgets, so we avoid using it in most cases. Frustrating behavior for a plugin that's officially supported.
-
Hello Guys,
We saw that using tabber plugins actually impacts the UX in terms of render time. So when you inspect element on a dashboard using tabber plugin, You will see the JAQL request as cancelled for all those widgets which are marked as hidden for the respective widget. These cancelled JAQL's actually adds stall time in the upcoming JAQL requests and hence increases the overall dashboard load time.
Anyone faced this issue and can suggest an alternative?
Thanks in advance!
Ankit Jindal -
Our Dashboard Tabber as detailed in the comment above, does just that,
Feel free to reach out for a live demo
Thanks
Ido
QBeeQ.pl
Sisense Partner of the Year 2019
-
Inbal Using v 8.0.2 on the cloud and have not been able to get widgets to display similar to Huanan Wu, Kara Schrader , Dot Q and Mitch Siwy. Sisense any advise? We can create the tabs in the script but no widgets or data displays.
Trying Kaileb Holland suggetion does not fix my issue.
Attached are images of what the Dashboard looks like and my script
-
Is there any way to use images as titles of the tabber?
widget.tabs = [
{
title: IMAGE1,
displayWidgetIds : ["55797a9459ef031011000032"],
hideWidgetIds : ["557d408a4630ccdc11000019"]
},
{
title: IMAGE2,
displayWidgetIds : ["557d408a4630ccdc11000019"],
hideWidgetIds : ["55797a9459ef031011000032"]
}
];
Please sign in to leave a comment.
Comments
76 comments