Last active
August 29, 2015 14:00
-
-
Save wolph/11204750 to your computer and use it in GitHub Desktop.
Testing Qlikview Extension scripts using Qva emulation outside of Qlikview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>Qlikview Extension Test</title> | |
<style> | |
html, body, #map-canvas { | |
height: 100%; | |
margin: 0px; | |
padding: 0px | |
} | |
#panel { | |
position: absolute; | |
top: 5px; | |
left: 50%; | |
margin-left: -180px; | |
z-index: 5; | |
background-color: #fff; | |
padding: 5px; | |
border: 1px solid #999; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="canvas"> | |
</div> | |
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<script> | |
template_path = document.location.href.replace(/test\.html/, ''); | |
Qva = { | |
Layout: { | |
Text0: { | |
text: { | |
toString: function(){ | |
return 'The output for text0'; | |
} | |
} | |
} | |
}, | |
Element: document.getElementById('canvas'), | |
GetWidth: function(){ | |
return 500; | |
}, | |
GetHeight: function(){ | |
return 500; | |
} | |
}; | |
Qva.LoadScript = function(url, f){ | |
jQuery.getScript(url, f); | |
} | |
Qva.LoadCSS = function(url){ | |
$('<link>') | |
.appendTo('head') | |
.attr({type : 'text/css', rel : 'stylesheet'}) | |
.attr('href', url); | |
} | |
Qva.AddExtension = function(name, f){ | |
var bounded_f = f.bind(Qva); | |
window.setTimeout(bounded_f, 100); | |
} | |
</script> | |
<script src="script.js"></script> | |
</body> | |
</html> |
Hi Stefan,
Sorry for the slow response, apparently gists don't give any notifications. You can simply open this script in your normal browser to test what the output would (probably) look like. "script.js" is the script included by Qlikview, I'm just giving an example of how the Qva API has to be implemented.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
is there any more full example how to use this?
Thanks!
Stefan