I. Overview
1.1 Problem description
Sometimes, there is too much information to be displayed in the report while the display interface is too small to fully display all the report content, so we may need to automatically hide the left navigation bar after opening the dashboard.
The effect is shown in the figure below. Opening Wealth Management does not automatically hide the navigation bar while opening Smart City will automatically hide it.
1.2 Implementation ideas
This can be achieved by adding an After Initialization event to the body of the dashboard.
II. Example
Take %FR_HOME%/webapps/webroot/WEB-INF/reportlets/demo/Dashboard/Smart City.frm as an example.
Select body and add the After Initialization event, as shown in the following figure:
The JavaScript code is as follows:
if ($('.bi-icon-change-button.unpin-font', window.parent.document).length > 0) {
$('.bi-icon-change-button.unpin-font', window.parent.document).click();
setTimeout(function() {
$('.slider-popup-wrapper', window.parent.document).width(0);
}, 100);
}
After saving the template, login the decision-making platform and mount the report to the directory for viewing.