close ();
The close method closes a dashboard.
To execute the example, the HTML page must contain an instance of the Kap.Dashboard class named dashBoard (see Dashboard constructor).
The repository must contain a dashboard with the key 826017.
In the BODY tag add buttons that open and close the dashboard:
<button id="openBut">Open dashboard</button>
<button id="closeBut">Close dashboard</button>
In the body of the onModuleInit function add event handler for buttons click:
document.getElementById("closeBut").onclick = function () {
dashBoard.close();
};
document.getElementById("openBut").onclick = function () {
dashBoard.open({
Key: "826017"
});
};
After executing the example the Open Dashboard and Close Dashboard buttons are added on the page. Clicking these buttons opens or closes the dashboard.
See also: