Category / Section
How to limit the characters in label
1 min read
Character limit support for label
The diagram provides to set the character limit support for the text. By using the editorFocusChange event, you can set the maximum text limit. The editorFocusChange event triggers when editor got focus at the time of node’s label or text node editing.
In this event, set the maxLength property for text box to limit the characters. Refer to the following code example to use the editorFocusChange event.
JS
$("#diagram").ejDiagram({ editorFocusChange: editorFocusChange, }) function editorFocusChange(args) { if (args.target) { args.target.maxLength = 20; } }
Sample link:
https://jsplayground.syncfusion.com/zdnrfwyu
Help documentation:
https://help.syncfusion.com/api/js/ejdiagram#events:editorfocuschange