Skip to content

Instantly share code, notes, and snippets.

@mindspank
Last active December 9, 2016 10:07
Show Gist options
  • Save mindspank/422dc55903b61bea6e6b to your computer and use it in GitHub Desktop.
Save mindspank/422dc55903b61bea6e6b to your computer and use it in GitHub Desktop.
Reload app using mashup api in a extension
define(['js/qlik', 'jquery'], function(qlik, $, $element) {
var id = 2;
return {
paint: function($element) {
var app = qlik.currApp();
$element.html("<button id='reload'>Reload</button>")
$('#reload').on('click', function(event) {
//get current handle
var handle = app.model.handle;
//Reload the app
app.model.session.socket.send(JSON.stringify({
"jsonrpc": "2.0",
"id": id,
"method": "DoReload",
"handle": handle,
"params": []
}));
id++
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment