Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Qlik Sense Mashup with Enigma.js - the official way
var prefix = window.location.pathname.substr(0, window.location.pathname.toLowerCase().lastIndexOf("/extensions") + 1);
var config = {
host: window.location.hostname,
prefix: prefix,
port: window.location.port,
isSecure: window.location.protocol === "https:"
};
require.config({
baseUrl: (config.isSecure ? "https://" : "http://") + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"
});
require(['js/qlik'], function (qlik) {
require(['enigma', 'autogenerated/qix/engine-api'], function (enigma, schema) {
var cfg = {
schema: schema,
session: {
host: window.location.hostname,
port: window.location.port || undefined,
prefix: undefined,
unsecure: window.location.protocol !== "https:",
reloadURI: undefined
}
};
enigma.getService('qix', cfg).then(function (qix) {
console.log('Do something!', qix);
qix.global.getDocList().then(function(docs){
console.log(docs);
});
}).catch(function (err) {
console.error('Something went wrong!', err);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.