We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

textchange event is not firing

Hi,
I want to get the current text and also the new text which is being added, and for this I am using textchangeproperty in the following manner:
HTML:
 <ejs-diagram #diagram id="diagram" width="100%" height="700px"  textChange="textchange()"></ejs-diagram>
         
COMPONENT.TS:
textChange(args: ITextEditEventArgs) {
    alert("abc");
  }

but is not calling when I start editing text of node on double clicking nor at the finish editing.

Please help!

3 Replies

SG Shyam G Syncfusion Team February 4, 2020 04:27 AM UTC

Hi Rakhi, 
 
There is no textChange event in the diagram control. Please use textEdit event which triggers once you edit the text and focus out of the text area. In this event, we get a new and the old text in the newValue and oldValue property respectively. Please refer to a help documentation, code example and the sample below. 
 

Code example: 
<ejs-diagram #diagram id="diagram" width="100%" height="700px    (textEdit)="textEdit($event)"
</ejs-diagram> 

  textEdit(args:ITextEditEventArgs) { 
     //get a new text and old text 
     console.log(args.newValue); 
     console.log(args.oldValue); 
 



 
Regards, 
Shyam G 



RA RakhiS replied to Shyam G February 5, 2020 06:22 AM UTC

Hi Rakhi, 
 
There is no textChange event in the diagram control. Please use textEdit event which triggers once you edit the text and focus out of the text area. In this event, we get a new and the old text in the newValue and oldValue property respectively. Please refer to a help documentation, code example and the sample below. 
 

Code example: 
<ejs-diagram #diagram id="diagram" width="100%" height="700px    (textEdit)="textEdit($event)"
</ejs-diagram> 

  textEdit(args:ITextEditEventArgs) { 
     //get a new text and old text 
     console.log(args.newValue); 
     console.log(args.oldValue); 
 



 
Regards, 
Shyam G 


Thanks,
It worked for me!


SG Shyam G Syncfusion Team February 6, 2020 03:52 AM UTC

Hi Rakhi, 
Thanks for your update. 
Regards, 
Shyam G 


Loader.
Live Chat Icon For mobile
Up arrow icon