Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
protogrid:script_library [2017-12-15 09:46] 46.140.51.3protogrid:script_library [2017-12-15 09:47] 46.140.51.3
Line 57: Line 57:
 If you want the code to be executed on load of every card, write your code into a separate JavaScript file and load it into the attachments section on the "Code"-Card. This attachments will be loaded whenever any Card is loaded and therefore will be executed on any card load. If you want the code to be executed on load of every card, write your code into a separate JavaScript file and load it into the attachments section on the "Code"-Card. This attachments will be loaded whenever any Card is loaded and therefore will be executed on any card load.
  
-==== Execute JS on field change === =+==== Execute JS on field change ====
  
 To execute some JavaScript when a field value changes, you need to add the following code-snippet to a client-side Script library, which is linked to the Proto with some Trigger. The variable "field_key_my_field" has to be set to the [[protogrid:field|fieldkey]] of the field you want to observe. "my_function()" is the function you want to call when something changes. To execute some JavaScript when a field value changes, you need to add the following code-snippet to a client-side Script library, which is linked to the Proto with some Trigger. The variable "field_key_my_field" has to be set to the [[protogrid:field|fieldkey]] of the field you want to observe. "my_function()" is the function you want to call when something changes.
Print/export