Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit fa55887

Browse files
serhiyzhovnirkeharper
authored andcommitted
Add documentation for the DynamicRowsRecord UI component (#5634)
* Add documentation for the DynamicRowsRecord UI component * Adjusted the DynamicRows record UI component documentation * Fixed the issue with spaces after list markers
1 parent 93bb8f5 commit fa55887

File tree

4 files changed

+98
-0
lines changed

4 files changed

+98
-0
lines changed

_data/toc/ui-components-guide.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ pages:
5050
- label: DynamicRows component
5151
url: /ui_comp_guide/components/ui-dynamicrows.html
5252

53+
- label: DynamicRowsRecord component
54+
url: /ui_comp_guide/components/ui-dynamicrows-record.html
55+
5356
- label: Email component
5457
url: /ui_comp_guide/components/ui-email.html
5558

Loading
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
group: ui-components-guide
3+
title: DynamicRowsRecord component
4+
contributor_name: Atwix
5+
contributor_link: https://www.atwix.com/
6+
---
7+
8+
The DynamicRowsRecord component is a container of record fields. The DynamicRowsRecord should be used as a child of the [DynamicRows]({{ page.baseurl }}/ui_comp_guide/components/ui-dynamicrows.html) component.
9+
10+
## Configuration options
11+
12+
| Option | Description | Type | Default |
13+
| --- | --- | --- | --- |
14+
| `disabled` | The initial state of the component. When set to `true`, users cannot take action on the element. | Boolean | `true` |
15+
| `headerLabel` | The label of the record. It is used as a record `label` when the `label` option is not initialized. | String | `''` |
16+
| `label` | The label of the record. | String | `''` |
17+
| `visible` | Initial component's visibility. When set to `false`, the `"display: none"` CSS style is added to the component's DOM block. | Boolean | `true` |
18+
19+
## Sources files
20+
21+
Extends [`UiCollection`]({{ page.baseurl }}/ui_comp_guide/concepts/ui_comp_uicollection_concept.html):
22+
23+
- [app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js]({{ site.mage2bloburl }}/{{page.guide_version}}/app/code/Magento/Ui/view/base/web/js/dynamic-rows/record.js)
24+
25+
## Examples
26+
27+
```xml
28+
<form>
29+
...
30+
<dynamicRows name="dynamic_rows">
31+
<settings>
32+
...
33+
</settings>
34+
<container name="record" component="Magento_Ui/js/dynamic-rows/record">
35+
<argument name="data" xsi:type="array">
36+
<item name="config" xsi:type="array">
37+
<item name="label" xsi:type="string" translate="true">Record Example</item>
38+
<item name="disabled" xsi:type="boolean">false</item>
39+
<item name="visible" xsi:type="boolean">true</item>
40+
<item name="componentType" xsi:type="string">container</item>
41+
</item>
42+
</argument>
43+
<field name="field_1" formElement="input">
44+
<argument name="data" xsi:type="array">
45+
<item name="config" xsi:type="array">
46+
<item name="fit" xsi:type="boolean">false</item>
47+
</item>
48+
</argument>
49+
<settings>
50+
<validation>
51+
<rule name="required-entry" xsi:type="boolean">true</rule>
52+
</validation>
53+
<dataType>text</dataType>
54+
<label>Field #1</label>
55+
</settings>
56+
</field>
57+
<field name="field_2" formElement="input">
58+
<argument name="data" xsi:type="array">
59+
<item name="config" xsi:type="array">
60+
<item name="fit" xsi:type="boolean">false</item>
61+
</item>
62+
</argument>
63+
<settings>
64+
<validation>
65+
<rule name="required-entry" xsi:type="boolean">true</rule>
66+
</validation>
67+
<dataType>text</dataType>
68+
<label>Field #2</label>
69+
</settings>
70+
</field>
71+
<actionDelete template="Magento_Backend/dynamic-rows/cells/action-delete">
72+
<argument name="data" xsi:type="array">
73+
<item name="config" xsi:type="array">
74+
<item name="fit" xsi:type="boolean">false</item>
75+
</item>
76+
</argument>
77+
<settings>
78+
<additionalClasses>
79+
<class name="some-class">true</class>
80+
</additionalClasses>
81+
<dataType>text</dataType>
82+
<label>Actions</label>
83+
<componentType>actionDelete</componentType>
84+
</settings>
85+
</actionDelete>
86+
</container>
87+
</dynamicRows>
88+
...
89+
</form>
90+
```
91+
92+
## Result
93+
94+
![DynamicRows Component with Record Component example]({{ site.baseurl }}/common/images/ui_comps/dynamicrows-record-result.png)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../v2.2/ui_comp_guide/components/ui-dynamicrows-record.md

0 commit comments

Comments
 (0)