Suppose the following piece of stupid code in a 5 page template:
<input id="foo" class="pat-pickadate" /> <input id="bar" /> <script type="text/javascript" > $('#bar').click( function () { $('#bar').addClass("pat-pickadate"); }); </script>
You will get two inputs. The first is a good calendar entry, and the second is empty at startup. After pressing the second input, its class will be set to "pat-pickadate" - as the first, but the calendar is not displayed.
I came across this while trying to find the reason why my jquery-UI overlays displaying plone add and editing views no longer work (Plone5) see the calendar view at all.
Is this behavior expected? If so, what is the correct way to use layout widgets in forms dynamically obtained by AJAX calls in Plone 5? Is there any magic call to tell Mockup machines about a change in the DOM?
I read that Mockup has its own overlay method, but it's hard to rewrite about 600 lines of complex JS code to get a simple widget.
I could not find any documentation and examples on this topic. Can someone put me in the right direction please?
source share