how to add javascript code
Collapse
X
-
Code:require(['views/modals/export'], View => { const defaultSetup = View.prototype.setup; View.prototype.setup = function () { defaultSetup.call(this); // Custom code. }; }); -
You can either build instance from sources (from the GitHub repository). But you will need to take care of upgrades by yourself, because upgrades will override your customization.
You can also monkey patch: https://github.com/espocrm/espocrm/issues/2890. You can custom JS scripts can be added with https://docs.espocrm.com/development...nt/#scriptlist. Note that for developer mode there's a separate parameter.
In your script you can require AMD module and perform monkey patching. But I would not recommend doing that as it's a not future-proof method.Leave a comment:
-
Hi,
Client JS files and templates are bundled and minified. You modify sources that are not used in the app.Leave a comment:
-
how to add javascript code
Good afternoon Tell me how to add code for export. So that the selected fields are successful. I do this, I edit the file /usr/share/nginx/html/client/res/templates/export/record, I wrote the code in it
Why is the code not running? The code works through the consoleCode:<script> function del() { var inputElement = document.querySelector('input[data-name="fieldList"].selectized'); var selectizeInstance = inputElement.selectize; selectizeInstance.clear(); } <script> <button onclick="del()">Clean</button>
I want it to be possible to remove all selected fields when clicking, so as not to click on each cross with the mouse. In short, how to add custom javascript to the system. Thanks for answers)
Last edited by hardware; 12-07-2023, 11:41 AM.Tags: None

Leave a comment: