Capability API

The Capability API is a collection of Qlik JavaScript APIs that allow you to easily embed Qlik Sense objects and content into a web page or mashup. It can be subcategorized into the following sub-APIs:

  • Root API
  • App API
  • Bookmark API
  • Field API
  • Selection API
  • Variable API
  • Visualization API
  • Global API
  • Navigation API
  • Table API

It's important to note that the Capability API is dependent on RequireJS and AngularJS (1.5), and those libraries need to be loaded as well as to be able to use it.

Each API will be introduced by its namespace. Namespacing is a technique employed to avoid collisions with other objects or variables in the global namespace. It's also extremely useful for helping organize blocks of functionality in your application into easily manageable groups that can be uniquely identified.

To use the Capability API, you will need to load the Qlik Sense implementation of RequireJS, and two CSS files to ensure visualizations and objects are styled as expected.

RequireJS (Qlik version), includes the following before the closing </body> tag, which loads the RequireJS library directly from Qlik Sense:

<script type="text/javascript" src="https://<qlik server>[:port]/<virtual proxy>/resources/assets/external/requirejs/require.js"></script>

In CSS, include the following in the <head> section of your page:

To avoid any surprises during Qlik Sense upgrades or similar, you should never take a copy of the following files but always reference them from your local Qlik Sense instance.
<link rel="stylesheet" href="https://<qlik server>[:port]/<virtual proxy>/resources/autogenerated/qlikui.css"> <link rel="stylesheet" href="https://<qlik server>[:port]/<virtual proxy>/resources/assets/client/client.css" media="all">
The virtual proxy may be omitted if you are connecting to the default virtual proxy. The same applies to the port if you are using the default ports for the current protocol (HTTP - 80, HTTPS - 443).

The Capability API is a reference in the code by loading the Qlik module via RequireJS. This is the case both for extensions and mashups, as in the following example:

require(['qlik'], function(qlik) {
var app = qlik.currApp();
app.field(Date).selectMatch('01/02/2017', true);
console.log(I've made a selection in the data model!)
});

Once you've successfully loaded the dependencies, you can then leverage the full list of sub-APIs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.142.2