determine whether the text has been changed, ( is dirty, modified)

Is there a build in flag to signal whether the text has been altered? Or even an event?

5 Replies 1 reply marked as answer

IS Indrajith Srinivasan Syncfusion Team January 4, 2021 05:21 AM UTC

Hi Otto, 
 
Greetings from Syncfusion support, 
 
We have validated your reported query. Yes, we have an event ValueChange for detecting the Value changes in the editor. If the SaveInterval property, is set as 1 and binding the event will trigger the change event immediately for the editor. By default, if the SaveInterval property is not configured the ValueChange event will be triggered after an timeout of 10000. Check the below code blocks for reference. 
  
  
@using Syncfusion.Blazor.RichTextEditor  
  
<SfRichTextEditor @ref="RteObj" SaveInterval=1>  
    <RichTextEditorEvents ValueChange="@onChanged"></RichTextEditorEvents>  
    <p>Rich Text Editor allows to insert images from online source as well as local computer where you want to insert the image in your content.</p>  
    <p><b>Get started Quick Toolbar to click on the image</b></p>  
    <p>It is possible to add custom style on the selected image inside the Rich Text Editor through quick toolbar.</p>  
</SfRichTextEditor>  
  
@code {  
    SfRichTextEditor RteObj;  
    public void onChanged()  
    {  
        System.Diagnostics.Debug.WriteLine(this.RteObj.Value);  
    }  
}  
  
   
Please let us know if the solution helps,  
  
Regards,  
Indrajith 



OT otto January 4, 2021 07:35 AM UTC

Thank you for your quick Reply. 

But:

What I'm missing there? 


IS Indrajith Srinivasan Syncfusion Team January 5, 2021 05:09 AM UTC

  
Hi Otto, 
 
We have checked the shared screenshot. The event ValueChange binding, must be in the separate RichTextEditorEvents tag. You have binded the event in the SfRichTextEditor editor tags. Modify the code blocks, like below and check the reported issue. 
 
 
@using Syncfusion.Blazor.RichTextEditor   
   
<SfRichTextEditor @ref="RteObj" SaveInterval=1>   
    <RichTextEditorEvents ValueChange="@onChanged"></RichTextEditorEvents>   
    <p>Rich Text Editor allows to insert images from online source as well as local computer where you want to insert the image in your content.</p>   
    <p><b>Get started Quick Toolbar to click on the image</b></p>   
    <p>It is possible to add custom style on the selected image inside the Rich Text Editor through quick toolbar.</p>   
</SfRichTextEditor>   
   
@code {   
    SfRichTextEditor RteObj;   
    public void onChanged()   
    {   
        System.Diagnostics.Debug.WriteLine(this.RteObj.Value);   
    }   
}   
 
 
 
 
Please get back to us if you still face any difficulties, 
 
Regards, 
Indrajith 


Marked as answer

OT otto January 5, 2021 10:06 AM UTC

Hi Indrajith,

perfect. the case is settled. as I suspected the fault was on my part. what I missed: the separation of object and object events was not clear to me.

thank you for your good work. I appreciate that.

best regards, otto


IS Indrajith Srinivasan Syncfusion Team January 6, 2021 04:35 AM UTC

Hi Otto, 
 
Thanks for the update, 
 
We are glad that our provided solution resolves the reported issue. Please get back to us if you need any further assistance. 
 
Regards, 
Indrajith 


Loader.
Up arrow icon