Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

gregory_longe
New Contributor III

Qlik Extension: Theme.js location differs in Qlik Sense versions

All,

Is there any way to determine the version of Qlik Sense in which the extension is running BEFORE the define statement in the main.js file? I am asking because I am using a file that has a different path depending on the version of Qlik Sense.

I am looking for something like this:

if(qlik.currVersion() = "2.0") { mPath = "path1"} else { mPath = "path2"};

define([mPath], function (mName) { })

Thanks in advance,

Kind regards

Gregory

Tags (2)
1 Solution

Accepted Solutions
gregory_longe
New Contributor III

Re: Qlik Extension: Theme.js location differs in Qlik Sense versions

Vincenzo,

Thanks for your answer. It seems a feasible way, but in the meantime I've implemented the following solution:

At the top of the paint function:

require(["core.utils/theme"], function (Theme) {

     Main(self, Theme);

}, function (err) {

     require(["text!themes/old/sense/theme.json"], function (Theme) {

          Theme = JSON.parse(Theme);

          Main(self, Theme);

     });

});

All other code in the paint function is placed in the Main function.

Kind regards

Gregory

2 Replies
ves
Valued Contributor

Re: Qlik Extension: Theme.js location differs in Qlik Sense versions

You can use the Engine API.

Have a look here

http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/EngineAPI/Content/GettingSystemInformation...

You can benefit from this wrapper

Qlik Branch

gregory_longe
New Contributor III

Re: Qlik Extension: Theme.js location differs in Qlik Sense versions

Vincenzo,

Thanks for your answer. It seems a feasible way, but in the meantime I've implemented the following solution:

At the top of the paint function:

require(["core.utils/theme"], function (Theme) {

     Main(self, Theme);

}, function (err) {

     require(["text!themes/old/sense/theme.json"], function (Theme) {

          Theme = JSON.parse(Theme);

          Main(self, Theme);

     });

});

All other code in the paint function is placed in the Main function.

Kind regards

Gregory