Skip to content

Commit c1be93f

Browse files
author
graschik
committed
Add docs for UI Components inside widgets
1 parent 356bc28 commit c1be93f

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ php bin/magento setup:static-content:deploy
3131
## Usage Documentation
3232
- UI Components
3333
- [Entities Selector](docs/ui-components/entities-selector/README.md)
34-
- Widgets (coming soon)
34+
- Widgets
35+
- `[Using UI Components Inside Widgets](docs/widgets/using-ui-components/README.md)`
3536

3637
## The MIT License
3738
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<h1>Using UI Components Inside Widgets</h1>
2+
3+
## What are the benefits?
4+
- You can use UI components inside widgets instead of limited functionality of widgets.
5+
- You don't need to worry about data storage as the data is automatically stored inside the widgets.
6+
- Easy to configure.
7+
8+
![](demo.gif)
9+
10+
## Example
11+
You can see an example of a widget with most of the available UI components. The widget is called "[Example Widget with UI Components](../../../etc/widget.xml)".
12+
13+
## How to use it?
14+
- Create [app/code/Vendor/Module/etc/widget.xml](../../../etc/widget.xml) file inside your module.
15+
- You have to add only one parameter ```block``` with class ```Grasch\AdminUi\Block\Adminhtml\Widget\Ui\Components```.
16+
- ```namespace``` is the name of your form.xml file.
17+
```xml
18+
<parameters>
19+
<parameter name="component_data" xsi:type="block">
20+
<block class="Grasch\AdminUi\Block\Adminhtml\Widget\Ui\Components">
21+
<data>
22+
<item name="namespace" xsi:type="string">widget_example_form</item>
23+
</data>
24+
</block>
25+
</parameter>
26+
</parameters>
27+
```
28+
- Create [app/code/Vendor/Module/view/adminhtml/ui_component/form.xml](../../../view/adminhtml/ui_component/widget_example_form.xml) file inside your module. Add the UI Components that you need here.
29+
- Use this class ```Grasch\AdminUi\DataProvider\Widget\DataProvider``` as ```dataProvider``` for your form.
4.5 MB
Loading

0 commit comments

Comments
 (0)