3
votes
"Product chooser" field for UI Component form
For large product catalog use this component with specified searchOptions and searchUrl:
<field name="products" component="Magento_Ui/js/form/element/ui-select" sortOrder="...
2
votes
Magento 2 save grid data from admin form
I have faced the same issue while I am saving data, selected items not getting in the save controller.
I have used this tutorial @ https://www.rohanhapani.com/magento-2-how-to-add-product-grid-in-ui-...
2
votes
How to make a form field readonly using ui-components?
For new version of Magento, you need to use <disabled>true</disabled> instead of <item name="disabled" xsi:type="boolean">true</item>
In fact, we don't use &...
1
vote
filter_url_params in magento 2 Ui component is not working properly anybody have solution
change di.xml and add replace <virtualType> of datasource with <type>
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
<...
1
vote
How to use addFieldToFilter on ui grid
in your listing.xml file above the line
<item name="update_url" xsi:type="url" path="mui/index/render"/>
add the id you are passing in the url like in my case
<...
1
vote
How to set default value for text and select field in admin new UI form in magento 2
If you want to use system.xml configuration you can create a custom field class:
ui component:
<field name="field_with_configurable_default_value" class="Vendor\Module\Ui\Component\...
1
vote
Set cache-control in HTTP headers for UI Components (Magento 2)
The value no-cache, must-revalidate, max-age=0 for Cache-Control that you see only applies to browser caches, which instructs Magento HTML to not be cached by them.
That Cache-Control that you're ...
1
vote
Accepted
How to make select ui component as a required entry in Magento 2
Use this elements in your form
Vendor_name/Module_name/view/adminhtml/ui_component
<field name="select_example" sortOrder="50" formElement="select">
<...
1
vote
Accepted
Filter Not Working for custom column ui_component grid Magento 2
In Your DataProvider File, there is a function named : addFilter(\Magento\Framework\Api\Filter $filter)
You have to modify that a little bit, I have added the sample code here, In which you can ...
1
vote
Accepted
How to filter admin grid collection based on certain condition in Ui component xml file New method
We can add a filterUrlParam to filter the grid.
<dataSource name="grid_record_grid_list_data_source" component="Magento_Ui/js/grid/provider">
<settings>
...
1
vote
Change label for Cart Price Rule
Create a folder in your theme "i18n" and add en_US.csv , with the help of en_US.csv you can change "Discount" string to another string, it's one of the easiest method.
1
vote
Product Grid show raw HTML code. Need Help about Ui Component
I found the solution.
https://newbedev.com/rendering-a-html-tag-in-grid-magento-2
Add this to Ui_Component column
<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html&...
1
vote
Get selected country id and region name in class LayoutProcessor of custom module
You cannot reach your goal through LayoutProcessor.php because in this way you define how your field will look like after it is rendered.
So in your layout processor you should define the select ...
1
vote
Accepted
"validate-number-range" validation not working in Adminhtml form created using Ui Component
The validate-number-range rule must have the type string and should have the range as its value, e. g. <rule name="validate-number-range" xsi:type="string">1-50</rule>.
...
1
vote
Execute jQuery after foreach loop in knockout template
According to the docs afterAdd is what you want:
afterAdd — is like afterRender, except it is invoked only when new
entries are added to your array (and not when foreach first iterates
over your ...
1
vote
Accepted
ImageUpload field missing on edit : Uncaught TypeError: Cannot create property 'previewType' on string
You have to pass image array that contains image url,name.
For passing it to ui component you can use dataprovider
<argument name=""class"" xsi:type=""string"&...
1
vote
Add a dynamic note for a product attribute in the adminhtml
simply change modifyMeta method to
public function modifyMeta(array $meta)
{
$containerPath = $this->arrayManager->findPath(static::CONTAINER_PREFIX . \Magento\Catalog\Api\Data\...
1
vote
Accepted
Magento DataProvider not populating data for edit in form
Try this
DataProvider.php
<?php
namespace Samplemodule\Faq\Ui;
use Samplemodule\Faq\Model\ResourceModel\Faq\CollectionFactory;
class DataProvider extends \Magento\Ui\DataProvider\...
1
vote
How to selected option in multiselect UI Component in Magento2
I Found the Solution for this.
$premiumCategory = json_encode($model->getData('premium_category'));
//output of $premiumCategory = ["32","167"];
$fieldset->addField(
...
1
vote
Accepted
How to selected option in multiselect UI Component in Magento2
in jquery:
first load js in your page then try below code
require([
'jquery',
'mage/backend/form'
], function($){
//simple way
$("#categoryList").val([&...
1
vote
Accepted
How to pass current value of Ui form field in js file
You have to add a custom js file via the validation
<field name="is_new_category_allowed">
<argument name="data" xsi:type="array">
<item name=&...
1
vote
Input values on the edit form are empty, using UI component- Magento 2
A few things are playing together here.
✅ Overall
<requestFieldName>id</requestFieldName> is going to be what you have configured (in your XML) your URL Parameter to be when the user ...
1
vote
same row content repeat in the whole page grid while navigate pagination
Just add storageConfig under the settings tag. It will fix the duplicate rows problem when sorting UI grid columns multiple times.
<dataSource name="...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
uicomponent × 1221magento2 × 941
grid × 172
magento-2.1 × 135
adminform × 107
ui-form × 104
adminhtml × 98
admin × 93
knockoutjs × 75
magento2.3 × 68
javascript × 56
magento2.2 × 50
forms × 46
checkout × 34
data-provider × 33
layout × 31
filter × 31
xml × 30
dynamic-rows × 30
requirejs × 24
collection × 23
ui-grid × 23
product × 21
module × 21
magento2.4 × 17