Javascript: EditableRegion.getUserName Method
Description
Gets the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.
Syntax
<void> EditableRegion.getUserName(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the name of the user who can edit the region. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates EditableRegion.getUserName in a practical document-editing workflow. It gets the name of the user who can edit the region. This parameter can be null or an empty string to indicate, that no user name has been specified and the region can be edited by everyone.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectUserName(editableRegion) {
editableRegion.getUserName(
function(result) {
console.log("get user name result:", result);
},
onTxError
);
}