开发者

Jquery simple modal close window and update parent

开发者 https://www.devze.com 2023-03-17 07:15 出处:网络
I want to execute some code inside a modal window that validates the data entered, if the data is saved successfully, I want to automatica开发者_运维问答lly close the modal window and refresh the pare

I want to execute some code inside a modal window that validates the data entered, if the data is saved successfully, I want to automatica开发者_运维问答lly close the modal window and refresh the parent window.

I've tried to call the modal close function, but no results.

<script>jQuery(function() {jQuery.modal.close();});</script>


Try this - in your main js:

// Open modal
$(foo).dialog(); 

// Listen for a trigger and close dialogue
$(foo).live('data_saved',function(){
    $(this).dialog('close'); // close modal
}

In your modal js:

// Inside modal, save your data - execute a trigger 
..whatever.trigger('data_saved');
0

精彩评论

暂无评论...
验证码 换一张
取 消