Module&View Specific JS
DataEngine allows to add custom JS to specific modules and views.
Create a file in custom/Extension/application/Ext/ViewJs/
with similar content:
<?php
if ($module === 'core_Accounts') {
$includes = [
'files' => [
[
'file' => 'custom/features/inside/accounts.js'
]
],
];
$view_js[] = [
'EditView' => $includes,
'QuickCreate' => $includes,
];
}
In this example the file custom/features/inside/accounts.js
will be added to the EditView and QuickCreate of the Accounts module.
Instead or in addition to files
, scripts
can be used to add inline JS, which is useful for configuration.
In the file custom/features/inside/accounts.js
you can add your custom JS,
which will be added after the form content.