Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to work more efficiently and test my extension object in a browser before bringing it into QV.
To do this, I need to have a stand-alone HTML to test on the browser. To avoid duplication, I want to import the relevant section of the stand-alone HTML into the QV extension object.
I attempted to do it as follows...
The problem I have is how to get the correct URL to address the HTML file which is on my local hard drive.
I tried
None of these attempts have worked, can anyone advise if this is possible?
Sample code...
var template_path = Qva.Remote + "?public=only&name=Extensions/CB/extension/";
function extension_Init() {
// Use QlikView's method of loading other files needed by an extension.
// These files should be added to your extension .zip file (.qar)
if (typeof jQuery == 'undefined') {
console.log('Loading jQuery...')
Qva.LoadScript(template_path + 'jquery.js', extension_Done);
}
else {
console.log('jQuery already loaded...')
extension_Done();
}
}
function extension_Done() {
//Add extension
Qva.AddExtension('CB/extension', function () {
//Load a CSS style sheet
Qva.LoadCSS(template_path + "extension.css");
var _this = this;
//Add empty container
$('div[title="extension"] ~ .QvContent').append("<div id='container'></div>");
//execute after doc loaded
$(document).ready(function () {
console.log('trying to load from ' + template_path);
$("#container").load(template_path + "extension.html #snippet",
function (response, status, xhr) {
var msg = 'body loaded status :';
if (status == 'error') {
console.error(msg + xhr.status + " " + xhr.statusText)
} else {
console.log(msg + 'Succsess')
}
console.log(msg + 'Complete')
})
})
});
}
//Initiate extension
extension_Init();