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

Commit 1fa3462

Browse files
authored
Merge pull request #6081 from eduard13/ui-thumbnail-column-component
Updating the ThumbnailColumn UiComponent documentation
2 parents 21b2d28 + 53a0be6 commit 1fa3462

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed
27.9 KB
Loading

guides/v2.2/ui_comp_guide/components/ui-thumbnailcolumn.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,38 @@ The ThumbnailColumn component implements a column containing images associated w
77

88
## Configuration options
99

10-
<table>
11-
<tr>
12-
<th>Option</th>
13-
<th>Description</th>
14-
<th>Type</th>
15-
<th>Default</th>
16-
</tr>
17-
<tr>
18-
<td><code>bodyTmpl</code></td>
19-
<td>Path to the template used for rendering a column's fields in the table's body.</td>
20-
<td>String</td>
21-
<td><code>ui/grid/cells/thumbnail</code></td>
22-
</tr>
23-
<tr>
24-
<td><code>fieldClass</code></td>
25-
<td>Additional CSS classes added to the column's field elements.</td>
26-
<td><code>{[name: string]: boolean}</code></td>
27-
<td><code>{'data-grid-thumbnail-cell': true}</code></td>
28-
</tr>
29-
</table>
10+
| Option | Description | Type | Default |
11+
| ------------ | -------------- | ---- | ------- |
12+
| `bodyTmpl` | Path to the template used for rendering a column's fields in the table body. | `String` | `ui/grid/cells/thumbnail` |
13+
| `fieldClass` | Additional CSS classes appended to the column's field elements. | `{[name: string]: boolean}` | `{'data-grid-thumbnail-cell': true}` |
14+
15+
## Examples
16+
17+
### Integrate the ThumbnailColumn component with the Listing component
18+
19+
This sample shows how the thumbnail column is added into the Product [Listing]({{ page.baseurl }}/ui_comp_guide/components/ui-listing-grid.html) component:
20+
21+
```xml
22+
<columns>
23+
<column name="thumbnail" component="Magento_Ui/js/grid/columns/thumbnail" class="Magento\Catalog\Ui\Component\Listing\Columns\Thumbnail">
24+
<settings>
25+
<hasPreview>1</hasPreview>
26+
<addField>true</addField>
27+
<label translate="true">Thumbnail</label>
28+
<sortable>false</sortable>
29+
</settings>
30+
</column>
31+
</columns>
32+
```
33+
34+
#### Result
35+
36+
![Thumbnail UiComponent]({{ site.baseurl }}/common/images/ui_comps/thumbnail-component-result.png)
3037

3138
## Source files
3239

40+
- [Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail]({{ site.mage2bloburl }}/{{ page.guide_version }}/app/code/Magento/Catalog/Ui/Component/Listing/Columns/Thumbnail.php)
41+
3342
Extends [`Column`]({{ page.baseurl }}/ui_comp_guide/components/ui-column.html):
3443

35-
- [app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js]({{ site.mage2bloburl }}/{{ page.guide_version }}/app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js)
44+
- [app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js]({{ site.mage2bloburl }}/{{ page.guide_version }}/app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js)

0 commit comments

Comments
 (0)