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.

Run an Event Script with Page Name
#1
Hi,
I have an event scripts like :
Event Script for Floor 1
Event Script for Floor 2

and also i have pages like :

Floor 1
Floor 2

I need that if user open Floor 1 in visualation, event script "Event Script for Floor 1" will run once.

How can i do that ?

Regards,
Reply
#2
If you are referring to Mosaic then this is not possible because it does not have Custom JavaScript support. In standard visualization there's a showplan event that is triggered when a new plan is opened. See this: https://forum.logicmachine.net/showthrea...6#pid20146
Reply
#3
(23.04.2021, 12:19)admin Wrote: If you are referring to Mosaic then this is not possible because it does not have Custom JavaScript support. In standard visualization there's a showplan event that is triggered when a new plan is opened. See this: https://forum.logicmachine.net/showthrea...6#pid20146

Hi,

In that example, if a new plan is opened, script orients to otherplan. I dont want to orient the page to other plan. I need to run an event script instead of orienting to other plan. Can you help for this specific need please ?
Reply
#4
Change plan IDs, group addresses and values as needed.
Code:
$(function(){
  if (typeof grp == 'undefined') {
    return;
  }
  
  $('body').on('showplan', function(event, id) {
    if (id == 2) {
      grp.write('0/0/1', 50);
    }
    else if (id == 3) {
      grp.write('0/0/1', 90);
    }
  }).trigger('showplan', [ currentPlanId ]);
});
Reply


Forum Jump: