ApiBlockLvlSdt

class ApiBlockLvlSdt

Description

Class representing a container for the document content.

Instance Methods

GetClassType(): blockLvlSdt

Returns a type of the ApiBlockLvlSdt class.

SetLock(sLockType)

Sets the lock to the current block text content control: "contentLocked" .

GetLock(): SdtLock

Returns the lock type of the current container.

SetTag(sTag)

Sets the tag attribute to the current container.

GetTag(): string

Returns the tag attribute for the current container.

SetLabel(sLabel)

Sets the label attribute to the current container.

GetLabel(): string

Returns the label attribute for the current container.

SetAlias(sAlias)

Sets the alias attribute to the current container.

GetAlias(): string

Returns the alias attribute for the current container.

GetContent(): ApiDocumentContent

Returns the content of the current container.

GetAllContentControls(): ApiBlockLvlSdt[] | ApiInlineLvlSdt[]

Returns a collection of content control objects in the current content control.

GetAllParagraphs(): ApiParagraph[]

Returns a collection of paragraph objects in the current content control.

GetAllTablesOnPage(nPage): ApiTable[]

R.

RemoveAllElements(): boolean

Clears the contents from the current content control.

Delete(keepContent): boolean

R.

SetTextPr(oTextPr)

Applies text settings to the content of the content control.

GetAllDrawingObjects(): ApiDrawing[]

Returns a collection of drawing objects in the current content control.

GetParentContentControl(): ApiBlockLvlSdt | "null"

Returns a content control that contains the current content control.

GetParentTable(): ApiTable | "null"

Returns a table that contains the current content control.

GetParentTableCell(): ApiTableCell | "null"

Returns a table cell that contains the current content control.

Push(oElement): boolean

Pushes a paragraph or a table or a block content control to actually add it to the current container.

AddElement(oElement, nPos): boolean

Adds a paragraph or a table or a block content control to the current container.

AddText(sText): boolean

Adds a text to the current content control.

GetRange(Start, End): ApiRange

Returns a Range object that represents the part of the document contained in the specified content control.

Search(sText, isMatchCase): ApiRange[]

S.

Select()

Selects the current content control.

GetPlaceholderText(): string

Returns the placeholder text from the current content control.

SetPlaceholderText(sText): boolean

Sets the placeholder text to the current content control.

GetPosInParent(): Number

Returns the content control position within its parent element.

ReplaceByElement(oElement): boolean

Replaces the current content control with a new element.

AddComment(sText, sAuthor, sUserId): ApiComment

A.

AddCaption(sAdditional, sLabel, bExludeLabel, sNumberingFormat, bBefore, nHeadingLvl, sCaptionSep): boolean

A.

GetDropdownList(): ApiContentControlList

Returns a list of values of the combo box / dropdown list content control.

MoveCursorOutside(isAfter)

Places a cursor before/after the current content control.

ToJSON(bWriteNumberings, bWriteStyles): JSON

Converts the ApiBlockLvlSdt object into the JSON object.

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).