Created
May 7, 2015 21:10
-
-
Save mindspank/905294636006b3b530a0 to your computer and use it in GitHub Desktop.
Leverage qsocks from within a mashup
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://sense-demo.qlik.com/resources/autogenerated/qlikui.css"> | |
<link rel="stylesheet" href="https://sense-demo.qlik.com/resources/assets/client/client.css" media="all"> | |
<script src="https://sense-demo.qlik.com/resources/js/external/requirejs/require.js"></script> | |
<script src="js/index.js"></script> | |
</head> | |
<body> | |
<button>Clear Selections with qSocks</button> | |
<div id="chart" style="width: 400px;height: 400px;"></div> | |
</body> | |
</html> |
This file contains hidden or 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
var me = { | |
config: { | |
host: 'sense-demo.qlik.com', | |
prefix: "/", | |
port: 443, | |
isSecure: true, | |
appname: 'a19163d6-1247-4795-a896-a4203cc44226' | |
}, | |
baseurl: 'https://sense-demo.qlik.com/resources' | |
}; | |
require.config({ | |
baseUrl: me.baseurl, | |
paths: { | |
qsocks: 'https://rawgit.com/mindspank/qsocks/master/qsocks.bundle' | |
} | |
}); | |
require(['jquery', 'js/qlik', 'qsocks'], function($, qlik, qsocks) { | |
app = qlik.openApp('a19163d6-1247-4795-a896-a4203cc44226', me.config); | |
qsocks.Connect(me.config).then(function(global) { | |
global.getActiveDoc().then(function(apphandle) { | |
$('button').on('click', function() { | |
apphandle.clearAll(); | |
}) | |
}) | |
}) | |
app.getObject('chart', 'zJNVdkm') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment