Right here we are going to examine in Magento 2 easy methods to present discover dynamically in UI element type fields.
Generally we’ve so as to add a observe beneath any type area to explain the sector or any info relating to the sector to the person.
<area identify="url">
<argument identify="information" xsi:kind="array">
<merchandise identify="config" xsi:kind="array">
<merchandise identify="dataType" xsi:kind="string">textual content</merchandise>
<merchandise identify="label" xsi:kind="string" translate="true">Url</merchandise>
<merchandise identify="formElement" xsi:kind="string">enter</merchandise>
<merchandise identify="supply" xsi:kind="string">worker</merchandise>
<merchandise identify="dataScope" xsi:kind="string">url</merchandise>
<merchandise identify="validation" xsi:kind="array">
<merchandise identify="validate-url" xsi:kind="boolean">true</merchandise>
</merchandise>
</merchandise>
</argument>
</area>We will add discover dynamically by overriding the getMeta perform within the type UI element information supplier class.
class DataProvider extends MagentoUiDataProviderAbstractDataProvider
{
protected $session;
protected $assortment;
protected $loadedData;
public perform __construct(
$identify,
$primaryFieldName,
$requestFieldName,
CollectionFactory $collectionFactory,
array $meta = [],
array $information = []
) {
father or mother::__construct($identify, $primaryFieldName, $requestFieldName, $meta, $information);
$this->assortment = $collectionFactory->create();
}
/**
* @inheritdoc
*/
public perform getMeta()
{
$meta = father or mother::getMeta();
$meta['mobikul_notification'] = [
'children' => [
'title' => [
'arguments' => [
'data' => [
'config' => [
'notice' => __('Label For Element')
]
]
]
]
]
];
return $meta;
}
}
Right here we are going to examine in Magento 2 easy methods to present discover dynamically in UI element type fields.
Generally we’ve so as to add a observe beneath any type area to explain the sector or any info relating to the sector to the person.
<area identify="url">
<argument identify="information" xsi:kind="array">
<merchandise identify="config" xsi:kind="array">
<merchandise identify="dataType" xsi:kind="string">textual content</merchandise>
<merchandise identify="label" xsi:kind="string" translate="true">Url</merchandise>
<merchandise identify="formElement" xsi:kind="string">enter</merchandise>
<merchandise identify="supply" xsi:kind="string">worker</merchandise>
<merchandise identify="dataScope" xsi:kind="string">url</merchandise>
<merchandise identify="validation" xsi:kind="array">
<merchandise identify="validate-url" xsi:kind="boolean">true</merchandise>
</merchandise>
</merchandise>
</argument>
</area>We will add discover dynamically by overriding the getMeta perform within the type UI element information supplier class.
class DataProvider extends MagentoUiDataProviderAbstractDataProvider
{
protected $session;
protected $assortment;
protected $loadedData;
public perform __construct(
$identify,
$primaryFieldName,
$requestFieldName,
CollectionFactory $collectionFactory,
array $meta = [],
array $information = []
) {
father or mother::__construct($identify, $primaryFieldName, $requestFieldName, $meta, $information);
$this->assortment = $collectionFactory->create();
}
/**
* @inheritdoc
*/
public perform getMeta()
{
$meta = father or mother::getMeta();
$meta['mobikul_notification'] = [
'children' => [
'title' => [
'arguments' => [
'data' => [
'config' => [
'notice' => __('Label For Element')
]
]
]
]
]
];
return $meta;
}
}




