Custom Jquery in detail view, where to add?
Collapse
X
-
Ok, without SPA logic, you can use this:
create file client.json in /custom/Espo/Custom/Resources/metadata/app/
create file foldpanels.js in /client/custom/js/Code:{ "scriptList": [ "__APPEND__" , "client/custom/js/foldpanels.js" ], "developerModeScriptList": [ "__APPEND__" , "path/to/your/js/file.js" ] }
Since the jquery on() function monitors $(document) for changes, this will even work after SPA rendering.Code:$(document).on("dblclick", ".panel-heading", function() { $(this).siblings().toggleClass("collapse"); });
Using $('.panel-heading') would not work here.Last edited by rinorway; 04-25-2019, 07:21 AM. -
Custom Jquery in detail view, where to add?
I would like to be able to collapse the panels by doubleclicking on the heading.
Where would you add this customisation for the detail view of any entity?
Thank you,Code:$('.panel-heading').each(function(){ $(this).dblclick(function() { console.log("toggle panel"); $(this).siblings().toggleClass("collapse"); }); });
Tags: None

Leave a comment: