Skip to content

Commit 0875364

Browse files
Update methods
1 parent dea2f9e commit 0875364

6 files changed

Lines changed: 78 additions & 9 deletions

File tree

docs/api/methods/destructor.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
sidebar_label: destructor()
3+
title: destructor Method
4+
description: You can learn about the destructor method in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText.
5+
---
6+
7+
# destructor()
8+
9+
### Description
10+
11+
@short: Removes all HTML elements of RichText, and detaches all related events
12+
13+
### Usage
14+
15+
~~~jsx {}
16+
destructor(): void;
17+
~~~
18+
19+
### Example
20+
21+
~~~jsx {4-5}
22+
const editor = new richtext.Richtext("#root", {
23+
// configuration parameters
24+
});
25+
// remove RichText
26+
editor.destructor();
27+
~~~

docs/api/methods/get-value.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can learn about the getValue method in the documentation of the
88

99
### Description
1010

11-
@short: Gets the editor value
11+
@short: Gets the RichText value
1212

1313
### Usage
1414

@@ -18,7 +18,7 @@ getValue(encoder?: any): string;
1818

1919
### Parameters
2020

21-
- `encoder` - (optional) a parser used to encode the editor's content into a custom format. The following formats are available: `html` (default) and `text`
21+
- `encoder` - (optional) a parser used to encode the RichText's content into a custom format. The following formats are available: `html` (default) and `text`
2222

2323
You can get the required encoder in the following way:
2424

docs/api/methods/set-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can learn about the setConfig method in the documentation of th
88

99
### Description
1010

11-
@short: Sets new configuration parameters
11+
@short: Applies new configuration parameters to RichText
1212

1313
### Usage
1414

@@ -18,7 +18,7 @@ setConfig(config: { [key:any]: any }): void;
1818

1919
### Parameters
2020

21-
- `config` - (required) the object of Richtext configuration parameters. See the full list of properties [here](/category/richtext-properties/)
21+
- `config` - (required) the object of RichText configuration parameters. See the full list of properties [here](/category/richtext-properties/)
2222

2323
:::note
2424
The `setConfig()` method preserves all the previously set parameters that are not explicitly provided in the `setConfig()` method call.

docs/api/methods/set-locale.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
sidebar_label: setLocale()
3+
title: setLocale Method
4+
description: You can learn about the setLocale method in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText.
5+
---
6+
7+
# setLocale()
8+
9+
### Description
10+
11+
@short: Applies a new locale to RichText
12+
13+
### Usage
14+
15+
~~~jsx {}
16+
setLocale(null | locale?: object): void;
17+
~~~
18+
19+
### Parameters
20+
21+
- `null` - (optional) resets to the default locale (*English*)
22+
- `locale` - (optional) the object of data of the new locale to be applied
23+
24+
:::info
25+
Use the `setLocale()` method to apply a new locale to RichText. To reset RichText to the default locale, call the `setLocale()` method without arguments (or with a *null* value).
26+
:::
27+
28+
### Example
29+
30+
~~~jsx {4-5}
31+
const editor = new richtext.Richtext("#root", {
32+
// configuration parameters
33+
});
34+
// apply the "de" locale to RichText
35+
editor.setLocale(de);
36+
~~~
37+
38+
**Related articles:** [Localization](guides/localization.md)

docs/api/methods/set-value.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can learn about the setValue method in the documentation of the
88

99
### Description
1010

11-
@short: Sets the editor value
11+
@short: Applies a new value to RichText
1212

1313
### Usage
1414

@@ -18,8 +18,8 @@ setValue: (value: string, encoder?: any): void;
1818

1919
### Parameters
2020

21-
- `value` - (required) a value to be inserted into the editor
22-
- `encoder` - (optional) a custom parser used to encode the editor's content into a custom format. The following formats are available: `html` (default) and `text`
21+
- `value` - (required) a value to be inserted into the RichText
22+
- `encoder` - (optional) a custom parser used to encode the RichText's content into a custom format. The following formats are available: `html` (default) and `text`
2323

2424
You can get the required encoder in the following way:
2525

sidebars.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ module.exports = {
3737
image: "/img/docusaurus.png"
3838
},
3939
items: [
40+
"api/methods/destructor",
4041
"api/methods/get-value",
4142
"api/methods/set-value",
42-
"api/methods/set-config"
43+
"api/methods/set-config",
44+
"api/methods/set-locale"
45+
4346
]
4447
},
4548
// JS RichText internal methods
@@ -67,7 +70,7 @@ module.exports = {
6770
image: "/img/docusaurus.png"
6871
},
6972
items: [
70-
"api/internal/detach",
73+
//"api/internal/detach",
7174
"api/internal/exec",
7275
"api/internal/intercept",
7376
"api/internal/on",
@@ -153,6 +156,7 @@ module.exports = {
153156
"api/config/fullscreen",
154157
"api/config/image-upload-url",
155158
"api/config/layout-mode",
159+
"api/config/locale",
156160
"api/config/menubar",
157161
"api/config/toolbar",
158162
"api/config/value"

0 commit comments

Comments
 (0)