The JavaScript file

This is the core JavaScript file, which is being picked up and read by Qlik Sense as well as your browser. It needs to carry the name of the extension as the name, and it needs to match the .qext file. Otherwise, it will not work. For loading the JavaScript file, RequireJS is being used, and, as such the following basic structure needs to be maintained:

define([],
function() {
return {
paint: function ($element, layout) {
$element.html("This is Mastering Qlik Sense");
}
};
});

This is a fundamental structure, which can be extended to include the following additional elements:

define([],
function() {
return {
paint: function(){},
resize: function(){},
initialproperties: {},
updateData: function(){}, //Feb 18'
definition: properties,
importProperties: function(){},
showRequirements: function(){},
support: {},
getExportRawDataOptions: function(){},
controller: [],
template: HTMLtemplate,
}
};
});

Bear in mind that you should always decide whether you wish your extension to be implemented using Angular (using controller and template) or the paint() method. You shouldn't have both at the same time. Which one you end up choosing is up to you!

Having said that, it's highly recommended to use the AngularJS approach wherever possible as it's much more stable and controllable and has many more possibilities on offer.

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

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