Skip to content

Commit 2f5e1cf

Browse files
authored
Merge pull request #33 from DHTMLX/next
[update] complete docs for v9.0
2 parents 3b1e989 + 68328bd commit 2f5e1cf

13 files changed

+143
-55
lines changed

docs/form/api/input/input_gettext_method.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ description: You can explore the getText method of the Input control of Form in
1414
A string with the text with the applied mask
1515

1616
@example:
17-
const value = form.getItem("input").getText();
18-
// -> "100000.01"
17+
const input = form.getItem("input");
18+
input.setValue(1000.01);
19+
20+
input.getValue(); // 1000.01 for the input type number
21+
input.getValue(); // "1000.01" for the input type string
22+
23+
input.getText(); // "1,000.01" with the applied numberMask/patternMask
1924

2025
@descr:
2126
The method is used with the [`numberMask`](form/work_with_form.md#numbermask) and [`patternMask`](form/work_with_form.md#patternmask) properties of the Input control. It allows getting the value with the applied mask.
2227

2328
@changelog:
2429
Added in v9.0
2530

26-
**Related:** [Getting the text value of an input](form/work_with_form.md#getting-the-text-value-of-an-input)
31+
**Related:** [Getting the text value of an input](form/work_with_form.md#getting-the-text-value-of-an-input-or-a-textarea)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
sidebar_label: getText()
3+
title: JavaScript Form - getText Textarea Method
4+
description: You can explore the getText method of the Textarea control of Form in the documentation of the DHTMLX JavaScript UI library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Suite.
5+
---
6+
7+
# getText()
8+
9+
@short: returns the text value of the textarea with the applied mask
10+
11+
@signature: {'getText(): string;'}
12+
13+
@returns:
14+
A string with the text with the applied mask
15+
16+
@example:
17+
const input = form.getItem("textarea");
18+
input.setValue(1000.01);
19+
20+
input.getValue(); // 1000.01 for the input type number
21+
input.getValue(); // "1000.01" for the input type string
22+
23+
input.getText(); // "1,000.01" with the applied numberMask/patternMask
24+
25+
@descr:
26+
The method is used with the [`numberMask`](form/work_with_form.md#numbermask) and [`patternMask`](form/work_with_form.md#patternmask) properties of the Textarea control. It allows getting the value with the applied mask.
27+
28+
@changelog:
29+
Added in v9.0
30+
31+
**Related:** [Getting the text value of a textarea](form/work_with_form.md#getting-the-text-value-of-an-input-or-a-textarea)

docs/form/features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ In this section you will study how to send a Form to the server, how to disable
103103
| [Is disabled](../work_with_form/#checking-if-a-form-is-disabled) | Learn how to check whether a Form or its control is disabled ([Example](https://snippet.dhtmlx.com/lthu8p6p)) |
104104
| [Hiding / showing Form](../work_with_form/#hidingshowing-a-form) | Learn how to hide/show a Form |
105105
| [Checking visibility of a Form](../work_with_form/#checking-if-a-form-is-visible) | Learn how to check whether a Form or its control is visible |
106+
| [Using input masks](../work_with_form/#using-input-masks) | Learn how to use pattern and input masks to provide entering of values in a predefined way ([Example 1](https://snippet.dhtmlx.com/51wnauq3), [Example 2](https://snippet.dhtmlx.com/gu1ekt1z)) |
106107
| [Clearing Form](../work_with_form/#clearing-form) | Learn how to clear the values and (or) validation of Form ([Example](https://snippet.dhtmlx.com/a64ih4ih)) |
107108

108109

docs/form/work_with_form.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ form.isVisible("input"); // -> returns true/false
107107

108108
## Using input masks
109109

110-
The input masks are used to provide entering of values into the [**Input**](form/input.md) and [**Textarea**](form/textarea.md) Form controls in a predefined way. There are the [`numberMask`](#numbermask) and [`patternMask`](#patternmask) configuration options in the API of the Input and Textarea controls, and the [`getText()`](#getting-the-text-value-of-an-input) method in the Input control API which are used for working with input masks.
110+
The input masks are used to provide entering of values into the [**Input**](form/input.md) and [**Textarea**](form/textarea.md) Form controls in a predefined way. There are the [`numberMask`](#numbermask) and [`patternMask`](#patternmask) configuration options in the API of the Input and Textarea controls, and the [`getText()`](#getting-the-text-value-of-an-input-or-a-textarea) method in the Input control API which are used for working with input masks.
111111

112112
### numberMask
113113

@@ -319,14 +319,19 @@ In the above example:
319319

320320
**Related sample**: [Form. Pattern mask](https://snippet.dhtmlx.com/gu1ekt1z)
321321

322-
### Getting the text value of an input
322+
### Getting the text value of an input or a textarea
323323

324-
When you need to get the value of an input with the applied mask, you can use the [`getText()`](form/api/input/input_gettext_method.md) method of the **Input** control.
325-
It returns the input value of the control as a string. The method is used with the `numberMask` and `patternMask` properties of the Input control.
324+
When you need to get the value of an input or a textarea with the applied mask, you can use the [`getText()`](form/api/input/input_gettext_method.md) method of the **Input** control or the [`getText()`](form/api/textarea/textarea_gettext_method.md) method of the **Textarea** control.
325+
It returns the input value of the control as a string. The method is used with the `numberMask` and `patternMask` properties of the control.
326326

327327
~~~jsx
328-
const value = form.getItem("input").getText();
329-
// -> "100000.01"
328+
const input = form.getItem("input");
329+
input.setValue(1000.01);
330+
331+
input.getValue(); // 1000.01 for the input type number
332+
input.getValue(); // "1000.01" for the input type string
333+
334+
input.getText(); // "1,000.01" with the applied numberMask/patternMask
330335
~~~
331336

332337
## Validating form

docs/grid/api/grid_closable_config.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ description: You can explore the closable config of Grid in the documentation of
1212
The described functionality requires PRO version of the DHTMLX Grid (or DHTMLX Suite) package.
1313
:::
1414

15+
:::note
16+
The `closable` property works only with the [`group`](grid/api/grid_group_config.md) panel.
17+
:::
18+
1519
@signature: {'closable?: boolean;'}
1620

1721
@default: true

docs/grid/api/grid_group_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You can find the detailed description of the `group` object properties with exam
6262
- if set to *false*, the rows that don't suit the grouping criteria won't be rendered
6363
- `fields` - (optional) predefines an extended configuration for data grouping by certain columns, by setting the rules of aggregation and rendering of the results. The attributes of the `fields` object correspond to the ids of columns for which the aggregation rules and the order of results are being configured. The configuration of a column is defined by the `IGroupOrder` object that has the following properties:
6464
- `map` - (optional) an object for data aggregation in a group, where the keys are field names, and the values can be:
65-
- a tuple `[string, TAggregate]` that specifies the field and the aggregation type ("sum", "count", "min", "max", "avg") from the `dhx.methods` helper
65+
- a tuple `[string, TAggregate]` that specifies the field and the aggregation type ("sum", "count", "min", "max", "avg") from the [`dhx.methods`](helpers/data_calculation_functions.md) helper
6666
- a user-defined aggregation function `((row: IRow[]) => string | number)`
6767
- `summary` - (optional) specifies where the total row is rendered - at the `top` or at the `bottom` of the group
6868
- `order` - (optional) defines the order of grouping by setting the sequence of columns for grouping. The elements of the `order` array can be:

docs/grid/customization.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,29 @@ You can easily set some styling to the text of footer cells by applying some inl
145145

146146
<script>
147147
const grid = new dhx.Grid("grid_container", {
148-
columns: [
149-
{
150-
width: 100, id: "a", header: [{ text: "#" }], footer: [
151-
{ text: '<div class="custom_footer">Total</div>', colspan: 3 },
152-
{ text: '<div class="custom_footer">Minimal value</div>', colspan: 3 }
153-
]
154-
},
155-
{ width: 100, id: "b", header: [{ text: "Title" }] },
156-
{ width: 200, id: "c", header: [{ text: "Order" }] },
157-
{ width: 200, id: "d", header: [{ text: "Price" }], footer: [
158-
{ content: "sum" }, { content: "min" }
159-
]
160-
}
161-
],
162-
data: dataset
163-
});
148+
columns: [
149+
{
150+
width: 200, id: "country", header: [{ text: "Country" }],
151+
footer: [
152+
{ text: '<div class="custom_footer">Total</div>' },
153+
{ text: '<div class="custom_footer">Minimal value</div>' },
154+
],
155+
htmlEnable: true
156+
},
157+
{
158+
width: 150, id: "population", header: [{ text: "Population" }],
159+
footer: [
160+
{ text: ({ totalPopulation}) => `${totalPopulation}`},
161+
{ text: ({ minimalValue }) => `${minimalValue}`}
162+
],
163+
},
164+
],
165+
summary: {
166+
totalPopulation: ["population", "sum"],
167+
minimalValue: ["population", "min"]
168+
},
169+
data: dataset
170+
});
164171
</script>
165172
~~~
166173

0 commit comments

Comments
 (0)