Remove data from JQuery dialog box when I close it

后端 未结 5 1362
醉话见心
醉话见心 2021-02-06 00:31

I have JQuery dialog box for inserting new row in table. And everything works good. Few days ago when I inserted FlexiGrid for Table started a problem for me. When I insert new

5条回答
  •  执念已碎
    2021-02-06 01:00

    Check Dialog Close event. You will need to store the state of dialogue, state will include (title, text etc), if you are modifying it.

    Update

    After reading the comment, what I got, giving answer according to it. Please correct me if I'm wrong.

    Before you open the dailog form, store the html to local variable and then before closing it set the html back to the dialogue.

    var originalContent;
    $("#newDialog-form").dialog({
       //Your Code, append following code
       open : function(event, ui) { 
          originalContent = $("#newDialog-form").html();
       },
       close : function(event, ui) {
          $("#newDialog-form").html(originalContent);
       }
    });
    

    Hope this helps you.

提交回复
热议问题