<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);
}
|
public selectionChange(args: ISelectionChangeEventArgs): void {
if(args.state == "Changing" && args.type == "Addition"){
// get id of selection node/connector
console.log(args.newValue[0].id);
}
} |
public selectionChange(args: ISelectionChangeEventArgs): void {
if(args.state == "Changing" && args.type == "Addition"){
// to find the selected object is a node
if(args.newValue[0] instanceof Node){
console.log('node');
}
// to find the selected object is a connector
if(args.newValue[0] instanceof Connector){
console.log('connector');
}
}
} |