Hi all,
I found a workaround to use the Javascript close() function so it's possible to close the visualization from a group address.
Since this function only works if the window was also opened by script we need to do this first.
First you need to add a startpage to your webbrowser using the Javascript code below as the url for the startpage.
javascript:window.open('192.168.0.10/scada-vis/','_self')
Then second you can use the script below as a Custom Javascript to close your visualization from the group address used in this script.
$(function(){
if (typeof grp != 'undefined') {
grp.listen('0/0/1', function(object, state) {
var value = object.value;
if (state == 'value') {
window.close();
}
});
}
});
I found a workaround to use the Javascript close() function so it's possible to close the visualization from a group address.
Since this function only works if the window was also opened by script we need to do this first.
First you need to add a startpage to your webbrowser using the Javascript code below as the url for the startpage.
javascript:window.open('192.168.0.10/scada-vis/','_self')
Then second you can use the script below as a Custom Javascript to close your visualization from the group address used in this script.
$(function(){
if (typeof grp != 'undefined') {
grp.listen('0/0/1', function(object, state) {
var value = object.value;
if (state == 'value') {
window.close();
}
});
}
});