Page tree
Skip to end of metadata
Go to start of metadata

Shape extends Element

This is the API model used to edit the area of the shape.

Methods

append(html)

  • html <String> HTML String to append.

The HTML String passed as an argument is added as a child at the back of the Element.

var shape = editor.getAPIModelById('id');
shape.append('<span>TEXT</span>');

prepend(html)

  • html <String> HTML String to append.

The HTML String passed as an argument is added as a child to the front of the Element.

var shape = editor.getAPIModelById('id');
shape.prepend('<span>TEXT</span>');

remove()

Removes the Element itself.

IF ALL ELEMENTS ARE REMOVED, ERRORS MAY OCCUR IN SUBSEQUENT OPERATIONS.

var shape = editor.getAPIModelById('id');
shape.remove();

replace(html)

  • html <String> The HTML String to replace.

Replaces the element itself with the HTML String passed as an argument.

var shape = editor.getAPIModelById('id');
shape.replace('<span>Shape replaced</span>');

setHTML(html)

  • html <String> HTML string to set inside the shape

Set the HTML string value passed as an argument to the internal HTML of the figure.

var shape = editor.getAPIModelById('id');
shape.setHTML('<p><span>Add HTML. All previously entered information will be erased.</span></p>');

setText(text)

  • text <String> Text string to set inside the shape

Set the text string value passed as an argument to the internal Text of the figure.

var  shape = editor.getAPIModelById('id');
shape.setText('Sample text.');
  • No labels