Here is a screenshot on what I did to help others ![]()
For context: I have a modal open via "row click" event, which then displays a modal allowing me to edit existing record or add a new one (which I also control the form via temp state to determine if it's going to be an insert vs update query).
I hide the "X" close button on modals via CSS. Then notice I added the "Close" button in the modal's upper right corner. Now, when closing the modal I check the IsDirty temp var and dynamicaly display the additional WARNING modal (if temp var is not dirty then WARNING modal doesn't fire, I simply close the main edit modal).
Ex
if( IsDirty.value == '1'){
modalWarn.open();
}else{
modal1.close();
}
