"Link to joined record" as popup window (ajax)

I don't think it was ever implemented, but a quick workaround in list_XX.js would be something like:
JavaScript:
jQuery(document).ready(function () {

    jQuery(document).on('click', '.tablename___elementname > a', function(e) {
        e.preventDefault();
        var myLink = jQuery(this).attr('href');
        Fabrik.getWindow({id:'some-unique-value', 'loadMethod': 'xhr', 'contentURL':myLink+'?format=partial&tmpl=component', 'title': "My Title"});
    });
 
});
Do not forget to change "tablename___elementname" to match yours.

And, if you do not have sef urls enabled, replace:
...myLink+'?format=partial&tmpl=component...
with
...myLink+'&format=partial&tmpl=component...
 
Last edited:
Thanks juuser, it works. I don't know javascript. Possible so open custom link? Link references to another site, and should contain 'raw' value databasejoin element.
 
Haven't tried opening external link in Fabrik modal window, but if you add your own link to element settings "Custom link" field, it might work.

You can add databasejoin element values like:
https://yourexternaldomain.com/?somevalue={tablename___databasejoin-element-name_raw}

Yes, field "Custom link" works, but it does not open in a modal window. If change link myLink in you code so that it refers to the external site? Or use iframe in settings "Custom link"?
 
External link in "custom link" opens in modal window for me. You likely have "Cross-origin" issues when you open link in another site. Check browser console when clicking the link. So if you have this issue, you need to set proper access in your another site. And if the other site needs logged in status for viewing the link, you also need to solve this. So it seems not to be the best idea to try to open external links in Fabrik modal.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top