getBlock(blockKey: String);
blockKey. Dashboard key.
The getBlock method returns dashboard block by identifier.
Dashboard block identifier can be obtained using one of the methods:
Tooltip. Select dashboard block, go to the side panel header and hover the cursor on block name. A tooltip with block name and its identifier is displayed:
The Dashboard.getMeta method.
To execute the example, make sure that the repository contains a dashboard with the 88665 key.
Create an HTML page with example of placing the KapBox component and execute the following operations:
Open the dashboard with the 88665 key:
Select the Document > Open main menu item
Execute the following in the console:
kapBox.open({
Key: 88665
});
Execute the following in the console:
var mdButton = new PP.Ui.Button({
ParentNode: "but",
Content: "Block identifier",
Click: function () {
var block = kapBox.getMeta().dataSourceObjects.its.it[0]; // object with first block identifier
console.log(block);
}
});
After executing the example, the Block Identifier button is displayed, clicking which displays first block identifier in the console.
Execute code containing the obtained block identifier in the console:
var currentblock = kapBox.getBlock("S3TXUVZY0URZ85XQ");
currentblock.setBlockTitleVisible(true);
After executing the example, the first block identifier is obtained, which, if specified, displays block title.
See also: