How to prevent popup from closing when using GRUD


I wonder if there is a way to prevent the popup from closing when using GRUD the reason it is that the user can cancel a file upload and not saving the changes to the db then the data still there while physically does not exist anymore…

I think preventing closing the popup without saving will be the solution!!!
any ideas!


I think it’s outside of the scope for ATK, perhaps something can be done in JS / Semantic


Thanks I will check it with semantic UI and post the solution here… thanks


Theres quite some examples, shouldn’t be too hard to achieve:


I have seen there is. in ATK a inside Modal.php an explanation about using


But this works only when I want to use your own modal…

but the issue it is that I need that for the GRUD when editing a record it opens instantly a Modal to edit the record… and this modal it is closable… and I need this to be non closable; I have not found where it is the code for preventing this when using the GRUD

Any ideas?


Ok, so to find out more about modals, here is how they were implemented:

  1. first jsModal was added:

It creates new modal markup and activates is with semantic ui. This code is more than a year old, so it has been cleaned up since then, but it should give you the idea.

  1. we added “static modals” or “Modal view” later. It adds a hidden modal div and only invokes semantic ui when needed.

so we have two implementations of modal. CRUD uses jsModal. They behave very similarly though.

ATK does not have support for setting modal “not closable”, but it’s doable in SemanticUI. Perhaps setOption here can help:

Still this won’t be usable in CRUD, because it uses jsModal:

so it would require some tweaks to the core classes to achieve your goal.


thanks for the info!!


I dont know if that really helps you, but I had some extra whishes for jsModals lately. I open them via custom JS code, here extra SUI modal options can be passed this way:

            "uri": eooConfig.url+"groups.php?action=createnew\x26addtotour="+$(this).attr("data-id")+"\x26render_in_modal=1",
            "modal": {'onHide': function() {$("#eooCalendarContent_form").form("submit"); return true;}},
            "title": "",
            "mode": "json",
            "uri_options": []


Thanks Phillips I will check this part of code and see if that can work some way…
is this part of code you mean inside… jsModal.php? right?


No, that is some custom JS code, not part of ATK.