To better understand the use-case and the solution Espen invited me to share some code...
Well,
in the CrudForm overriding the link method and so having rendered the link to the editform that we want to put in the pat-modal flavor
...
def link(self, item, field):
#...
if field == 'scadenza': # <- the column we want to show as link
return u'@@myeditform?uid={}'.format(item.uid)
#...
In the CrudEditSubForm, to easly catch in the next step the span-tag inside the really modal-triggering anchor tag:
...
def updateWidgets(self):
super(CredTempEditSubForm, self).updateWidgets()
w = self.widgets.get('view_scadenza')
w.addClass('pat-plone-modal') # <- this unfortunately will go into the <span> tag of the field macro
In the page template some jquery to complete the job
(function($) {
$(document).ready(function(){
$amodal = $('span.pat-plone-modal').parents('a');
$amodal.addClass('pat-plone-modal');
var data = '{"actionOptions": {"displayInModal": true}}';
$amodal.attr('data-pat-plone-modal', data);
[...]
})(jQuery);
In this way, Plone gives a response of this html (for each row of the z3c crud table of course):
<td class="field">
<a href="@@myeditform?uid=foo.bar" class="noaccess" title="account disabilitato">
<span id="crud-edit-foo-bar-widgets-view_scadenza" class="date-widget date-field pat-plone-modal">29/05/19</span>
</a>
</td>
JQuery adds the modal behavior and options to the anchor link
<td class="field">
<a href="@@myeditform?uid=foo.bar" class="noaccess pat-plone-modal" title="account disabilitato"
data-pat-plone-modal="{"actionOptions": {"displayInModal": true}}">
<span id="crud-edit-foo-bar-widgets-view_scadenza" class="date-widget date-field pat-plone-modal">29/05/19</span>
</a>
</td>
@@myeditform is rendered inside a modal pop-up; every submit is handled inside this modal through ajax calls; and every form status messages, error or succes one, is rendered inside the modal.
HTH,
alessandro