There are a few differences that you should note when developing plugins for Sisense Mobile.
First, the navigation flow for Sisense Mobile is fixed, homepage that includes your dashboard list, the dashboard, and the widget. This means that a widget that is opened as part of a dashboard behaves differently than a widget that is opened in Widget Mode.
To keep Sisense Mobile’s navigation flow and look and feel, modifying or creating DOM elements outside the widget container is not supported.
Widgets that are rendered as part of a dashboard have the same screenWidth as the other widgets within the dashboard. Widgets that are rendered in Widget Mode, can occupy the entire screen minus the space of the Navigation bar and tooltip pans for chart widgets. You should develop your widgets to behave responsively to fit various screen sizes in landscape and portrait views.
Sisense Mobile can render a single widget instance in different containers. For each render call, the plugin should use unique IDs for its DOM elements.
Another difference between working with plugins in the Sisense Web Application and Sisense Mobile is that in mobile plugins, users can only interact with a widget in Widget Mode. The user must select the widget first from the dashboard, then they can interact with it.
Some plugins are only suitable on the Web, while others are only suitable on mobile devices. Sisense has added a new property to the widget manifest (widget.js), called
This property should be included in the registerWidget of the prism object, for example:
When this property is set to true, Sisense Mobile ignores the plugin. This property is useful for plugins that should be used only on the Sisense Web Application and not Sisense Mobile.
You can also set your plugins to behave differently on the Sisense Web Application and Sisense Mobile with a conditional that checks for the presence of the window.sisenseMobileApp object in the plugin script. For example,
Note: Navigation links based on <a href=""> tags are not supported within Sisense Mobile. To open a dashboard in Sisense Mobile, use the helper function window.sisenseMobileApp.navigateToDashboard(dashboardId). For other types of navigation links, use window.open.
You can download the plugin here.
This example contains three files:
Config.js: This file contains the dashboard ID to be modified in Sisense Mobile and an array of widget IDs in the order of the widget’s are to be displayed.
Plugin.json: This file contains the plugin’s metadata so Sisense Mobile knows which files to associate with the plugin and what the plugin is called. This file is also important so your Sisense Administrator can manage the plugin from the Admin console in the Sisense Web Application.
mobileDashboardReorder.js: This file contains the logic for reordering the dashboard and widgets when the dashboard is displayed in Sisense Mobile.
To implement this MobileDashboardReorder plugin, download the file above and unzip the contents into the following directory as you would with any Sisense plugin:
Then, restart the web server.
Next, you need to modify the plugin files and add your Dashboard ID and Widget IDs as described below.
You can add multiple Dashboards and order their widgets as you like. Any dashboards not defined in the dashboardsMap variable will be rendered as a regular dashboard in the Sisense Mobile app.
For Sisense 7.2 Beta Users
In Sisense V7.2 Beta, the location has been changed to
Your existing plugins will be migrated to the new location when upgrading to v7.2 Beta.
For more information, please see the v7.2 Developer Release Notes
The config.js defines the dashboard to be modified in Sisense Mobile and the order of the widgets according to their Widget ID and position in an array of widgets.
Replace the dashboard ID example with your ID and the widget IDs with yours. The order of the widget IDs determines which widgets are displayed at the top of dashboard in Sisense Mobile. You can add or remove widgets from the array as needed.
For more information on how to obtain your dashboard and widget IDs, see Embedding Dashboard Widgets.
Sisense uses the plugin.json to implement the plugin. This file contains the following properties:
Name: THe name of the plugin.
Source: The files associated with the mobileDashboardReorder plugin.
Lastupdate: Indicates the last time the plugin was updated.
FolderName: The name where the plugin files are stored within the plugin directory.
This file contains the logic for determining when the MobileDashboardReorder plugin should be implemented. The logic is a simple condition that when the sisenseMobileApp object is rendered, run the MobileDashboardReorder plugin.