Last active
December 9, 2016 10:07
-
-
Save mindspank/422dc55903b61bea6e6b to your computer and use it in GitHub Desktop.
Reload app using mashup api in a extension
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
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