This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

close window
#19
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();
      }
    });
  }
});
Reply


Messages In This Thread
close window - by Daponte - 11.02.2019, 07:18
RE: close window - by admin - 11.02.2019, 07:44
RE: close window - by Daponte - 11.02.2019, 07:57
RE: close window - by admin - 11.02.2019, 08:06
RE: close window - by Daponte - 11.02.2019, 08:44
RE: close window - by admin - 11.02.2019, 09:00
RE: close window - by Daponte - 11.02.2019, 09:30
RE: close window - by admin - 11.02.2019, 09:41
RE: close window - by Daponte - 11.02.2019, 09:55
RE: close window - by admin - 11.02.2019, 10:32
RE: close window - by Daponte - 11.02.2019, 10:50
RE: close window - by admin - 11.02.2019, 10:58
RE: close window - by Daponte - 11.02.2019, 11:20
RE: close window - by admin - 11.02.2019, 11:33
RE: close window - by Daponte - 11.02.2019, 11:37
RE: close window - by Daniel - 11.02.2019, 12:08
RE: close window - by Daponte - 11.02.2019, 14:06
RE: close window - by Daniel - 11.02.2019, 14:13
RE: close window - by Joep - 16.11.2019, 15:41

Forum Jump: