CoreBOSBB
Javascript hook: reference field save - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18)
+--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4)
+--- Thread: Javascript hook: reference field save (/showthread.php?tid=1742)



Javascript hook: reference field save - Guido1982 - 03-24-2020

I know we have popup hooks for Javascript, but I'm running into something else. I load some content in a custom block through AJAX. When I open a popup on a UI10 field on that record and select a related record through the inline edit (so NOT opening the entire record for editing) There is some AJAX reloading of the page that empties my custom block. Is there a way I can hook into that action so I can reload my content as well?


RE: Javascript hook: reference field save - joebordes - 03-25-2020

inline edit reloads the whole detail view body. it calls DetailView.php again and loads the result into the contents of the detail view div
it then scans that HTML for javascript and executes it.
so you have to make sure that the code your block needs to work is loaded inside the detail view body


RE: Javascript hook: reference field save - Guido1982 - 03-26-2020

You're right. I had it in an external JS file in a window.load handler. Moved the init function to the custom block and it worked