Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Forcing an on change event event to fire

1524736170

Edited 1524736722
David
Sheet Author
I am setting a number of attributes using setAttrs in the sheet:opened event, these attributes are used to calculate other attributes using on change events.   Sometimes the on change events for the attributes I set in the sheet:opened event are fired and sometimes there are not. Is there a way of forcing an event to fire.  I have quiet set to false in setAttrs.
1524737411
Jakob
Sheet Author
API Scripter
David said: I am setting a number of attributes using setAttrs in the sheet:opened event, these attributes are used to calculate other attributes using on change events.   Sometimes the on change events for the attributes I set in the sheet:opened event are fired and sometimes there are not. Is there a way of forcing an event to fire.  I have quiet set to false in setAttrs. If the attributes aren't actually changed, then the event doesn't fire, that may be your problem. Instead of forcing the event to fire, why don't you run the corresponding function directly?
1524738199
David
Sheet Author
It is ok I was making things complicated. I was being lazy the code is not supposed to go in the on:opened, I just placed in there to test it.  I moved it to an on:change for a checkbox and it works fine.  Thanks for the help.