Re: editor.SetClean() -to complement editor.IsDirty()

  •  04-04-2014, 9:19 AM

    Re: editor.SetClean() -to complement editor.IsDirty()

    Hi jeff330ci,

     

    You can achieve your requirement by the code below.  Value GetContentVersion will be changed when fire the new IsDirty. If is the same IsDirty, then do not need to save the content.

     

    1. <script type="text/javascript">  
    2.     var savedver=0;  
    3.     function save()  
    4.     {  
    5.         var editor1 = document.getElementById('<%= Editor1.ClientID%>').editor;  
    6.         var newdver = editor1.GetContentVersion();  
    7.         if (editor1.IsDirty())  
    8.         {  
    9.             if (newdver == savedver) {  
    10.                 //no changed  
    11.                 alert("no change, so do not save content");  
    12.             }  
    13.             else {  
    14.                 //save content  
    15.                 alert("save content");  
    16.                 savedver = editor1.GetContentVersion();  
    17.             }  
    18.         }  
    19.     }  
    20. </script>  
     

    Regards,

     

    Ken 

View Complete Thread