obiz

Custom Scripting Library

The Custom Scripting Library (CSL) allows a configurator to use functions that will be triggered during runtime events.

Custom Scripting

With custom scripting you inject custom JavaScript code in the various events available in the ADM. This enables to change the styling or default behaviour of the ADM. A few examples why to use custom scripting:

  • hide form fields based on a condition;
  • make fields required based on a condition;
  • change the cell or row color of a multi record view;
  • show or hide buttons based on a row value;
  • ...

Custom scripting is very powerful but it should be used with care. Only use custom scripting if you fully understand the following points for attention.

No Security

Custom scripting is always JavaScript code and is executed on the client, the web browser. JavaScript can easily be bypassed. Therefore, it is only used to enhance the user experience. An example: if you make form fields required based on a condition, you always need to perform the "required check" in the backend system.

Only Use CSL

It is strongly recommended to only use functions from the CSL. The CSL or Custom Scripting Library, is a set of functions which will be supported by ADM and remain backwards compatible as much as possible.

If you target other arguments from functions or you target directly HTML elements keep in mind that this cannot be supported. CSL often gives you the possibility to pass in a condition. This condition is a JavaScript function which is not part of the CSL.

Performance

Make sure you code is fast. ADM has no longer support for Internet Explorer so you can safely use functions from ES2015 or later.

Upgrades of Ometa Framework

Always check the changelog and look for deprecations or breaking changes in the CSL. We try to limit this as much as possible but sometimes there is no other choice.

All other JavaScript code is your responsibility and should be checked with every upgrade.

Generated using TypeDoc