Dashboard.getBlock

Syntax

getBlock(blockKey: String);

Parameters

blockKey. Dashboard key.

Description

The getBlock method returns dashboard block by identifier.

Comments

Dashboard block identifier can be obtained using one of the methods:

Example

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:

  1. Open the dashboard with the 88665 key:

kapBox.open({
    Key: 88665
});
  1. 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.

  1. 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:

Dashboard