Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

View solution in original post

2 Replies
Vincenzo_Esposito

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

Anonymous
Not applicable
Author

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