# Javascript: TXTextControl.getSubTextParts Method

> Obsolete. This method will be removed in one of the next versions. Requests a collection of either all subtextparts the current text part contains or only the subtextpart containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

> **Note:** This is deprecated and should not be used in new work.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 25.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.getSubTextParts Method
- **413 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsubtextparts-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsubtextparts-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsubtextparts-method/llms-full.txt

---

### Description

`Obsolete. This method will be removed in one of the next versions.` Requests a collection of either all [subtextparts](https://docs.textcontrol.com/ds-server/reference/javascript/subtextpart/llms-full.txt) the current text part contains or only the subtextpart containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

### Syntax

```javascript
<void> TXTextControl.getSubTextParts(<function> callback, [<boolean> atInputPosition])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | A function with one parameter. Is called with an array of [subtextparts](https://docs.textcontrol.com/ds-server/reference/javascript/subtextpart/llms-full.txt) as a parameter containing the requested text fields as soon as the information has been retrieved from the server. |
| atInputPosition | Optional. A boolean value indicating that only the SubTextPart containing the input position should be retrieved. If there is no subtextpart at the input position, an empty array is received. |

### Examples

The following example demonstrates `TXTextControl.getSubTextParts` in a practical document-editing workflow. Obsolete. This method will be removed in one of the next versions. Requests a collection of either all subtextparts the current text part contains or only the subtextpart containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.

```javascript
TXTextControl.getSubTextParts(
    function() {
        console.log("get sub text parts completed.");
    },
    true
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.getStatusBarColor Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getstatusbarcolor-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.getSupportedFonts Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsupportedfonts-method/llms-full.txt)
