-
July 20th, 2017, 08:51 #1
- Join Date
- Mar 2015
- Posts
- 7
Change my value from an another field
Hello everyone,
from my field A, I know change an another value (B for example) when the Field's value A change with "OnValueChanged".
But I try to do the opposite : from my value A, I want that this value change when an another value change (I don't want use "OnValueChanged" on this another field.)
Is there a function like 'OnSourceChanged" ?
I see in 3.5 template_char some templates with "<source>...</source><op>+</op>".Is the good way ?
Thanks for your help.
-
July 20th, 2017, 13:46 #2
Yes, but you need to create the event handler for onValueChanged on the FG control you want, using the GUI hierarchy, e.g. if your control is called "mydatafield" then you can access that in the current window with window.mydatafield and then write a handler function look at onValueChanged on that control, e.g. window.mydatafield.onValueChanged = myCustomOnValueChangedFunction
See "Handler Functions" at the bottom of this page here: https://www.fantasygrounds.com/modguide/scripting.xcp The example given is creating a sourceUpdate function for a different database node.
This will add the contents of the <source> database node together with other <source> database nodes. Or, if there is just one <source> entry, it will essentially link the field directly to that database node. So, if you want to add (or subtract) data from database fields or link to a single database field, then this is a good way to go.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
July 22nd, 2017, 13:51 #3
- Join Date
- Mar 2015
- Posts
- 7
Hello,
thanks for your help !
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks