Skip to main content

registerExtension method

Information noteSTABLE.

This API is reliable and breaking changes are unlikely.

qlik.registerExtension(id, impl, metadata)

Registers an extension for use in this mashup. The extension is not installed on the Qlik Sense server and only available in the session where it is created.

As long as a JavaScript module is created in the correct format, it can be sent to the registerExtension function.

Version history

Version history
Version state Details
Introduced 2.2

Parameters

id

Type: String

Set the ID of the visualization extension.

impl

Type: Object

Set the extension implementation.

metadata

Type: Object

Optional. Extension meta-data, same format as the QEXT file.

Default: {"type":"visualization"}

Anatomy of the QEXT file

Examples

Example: Hello world on the fly

//define the helloworld extension
var helloworld = {

		paint: function ($element) {
			$element.html( "Hello world!!" );
		}
		
}
//register the extension
qlik.registerExtension( 'helloworld', helloworld );
 
var app = qlik.openApp( 'app file name or ID', config );
//create and show an object using the extension
app.visualization.create( 'helloworld', ["Case Owner Group"] ).then( function ( helloworld ) {
    helloworld.show( "QV00" );
} );