getService ()
The getService method returns an instance of service used to work with block data source.
To execute the example the page must contain a dashboard designed named kapBox, and the currentBlock variable must be defined in the page. This variable must contain selected dashboard block (see Kap.KapBox). The BODY tag must contain a DIV element with the "but" identifier. Add a button clicking which will bring up a message containing identifier of service for working with data source of selected block:
var serviceButton = new PP.Ui.Button({
ParentNode: "but",
Content: "Service identifier",
Click: function () {
alert("Service identifier: " + currentBlock.getService().getId());
}
});
After executing the example the Service Identifier button is placed in the page. Clicking this button brings up a message that contains ID of the service for working with data source of selected dashboard block.
See also: