Magento 2.2.5: How to create dropdownlist in Ui-component
As i said in the post, i wanna know how to create a dropdownlist in ui component, or atleast i need to know how the dropdownlist work, for example, in C:xampphtdocsmagentovendormagentomodule-customerviewadminhtmlui_componentcustomer_listing.xml
.
I wanna make Gender
render 2 column, Male and Female.
And Class
also. Maybe it will render 5 class. Ex: Math, History...
Here is my ui-component:
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing_data_source</item>
</item>
</argument>
<settings>
<buttons>
<button name="add">
<url path="*/*/new"/>
<class>primary</class>
<label translate="true">Add New Customer</label>
</button>
</buttons>
<spinner>customer_columns</spinner>
<deps>
<dep>customer_listing.customer_listing_data_source</dep>
</deps>
</settings>
<dataSource name="customer_listing_data_source" component="Magento_Ui/js/grid/provider">
<settings>
<updateUrl path="mui/index/render"/>
</settings>
<aclResource>Magento_Customer::manage</aclResource>
<dataProvider class="MagentoCustomerUiComponentDataProvider" name="customer_listing_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>entity_id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<listingToolbar name="listing_top">
<settings>
<sticky>true</sticky>
</settings>
<bookmark name="bookmarks"/>
<columnsControls name="columns_controls"/>
<exportButton name="export_button"/>
<filterSearch name="fulltext"/>
<filters name="listing_filters"/>
<massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
<action name="delete">
<settings>
<confirm>
<message translate="true">Are you sure to delete selected customers?</message>
<title translate="true">Delete items</title>
</confirm>
<url path="customer/index/massDelete"/>
<type>delete</type>
<label translate="true">Delete</label>
</settings>
</action>
<action name="subscribe">
<settings>
<url path="customer/index/massSubscribe"/>
<type>subscribe</type>
<label translate="true">Subscribe to Newsletter</label>
</settings>
</action>
<action name="unsubscribe">
<settings>
<confirm>
<message translate="true">Are you sure to unsubscribe selected customers from newsletter?</message>
<title translate="true">Unsubscribe from Newsletter</title>
</confirm>
<url path="customer/index/massUnsubscribe"/>
<type>unsubscribe</type>
<label translate="true">Unsubscribe from Newsletter</label>
</settings>
</action>
<action name="assign_to_group">
<settings>
<type>assign_to_group</type>
<label translate="true">Assign a Customer Group</label>
<actions class="MagentoCustomerUiComponentMassActionGroupOptions"/>
</settings>
</action>
<action name="edit">
<settings>
<callback>
<target>editSelected</target>
<provider>customer_listing.customer_listing.customer_columns_editor</provider>
</callback>
<type>edit</type>
<label translate="true">Edit</label>
</settings>
</action>
</massaction>
<paging name="listing_paging"/>
</listingToolbar>
<columns name="customer_columns" class="MagentoCustomerUiComponentListingColumns">
<settings>
<editorConfig>
<param name="clientConfig" xsi:type="array">
<item name="saveUrl" xsi:type="url" path="customer/index/inlineEdit"/>
<item name="validateBeforeSave" xsi:type="boolean">false</item>
</param>
<param name="indexField" xsi:type="string">entity_id</param>
<param name="enabled" xsi:type="boolean">true</param>
<param name="selectProvider" xsi:type="string">customer_listing.customer_listing.customer_columns.ids</param>
</editorConfig>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing.customer_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
<item name="1" xsi:type="boolean">true</item>
</item>
</param>
</childDefaults>
</settings>
<selectionsColumn name="ids" sortOrder="10">
<settings>
<indexField>entity_id</indexField>
</settings>
</selectionsColumn>
<column name="entity_id" sortOrder="20">
<settings>
<filter>textRange</filter>
<label translate="true">ID</label>
<sorting>asc</sorting>
</settings>
</column>
<column name="name" sortOrder="30">
<settings>
<filter>text</filter>
<label translate="true">Name</label>
</settings>
</column>
<column name="email" sortOrder="40">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Email</label>
</settings>
</column>
<column name="group_id" component="Magento_Ui/js/grid/columns/select" sortOrder="50">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Group</label>
</settings>
</column>
<column name="billing_telephone" sortOrder="60">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Phone</label>
</settings>
</column>
<column name="billing_postcode" sortOrder="70">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">ZIP</label>
</settings>
</column>
<column name="billing_country_id" component="Magento_Ui/js/grid/columns/select" sortOrder="80">
<settings>
<filter>select</filter>
<dataType>select</dataType>
<label translate="true">Country</label>
</settings>
</column>
<column name="billing_region" sortOrder="90">
<settings>
<filter>text</filter>
<label translate="true">State/Province</label>
</settings>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="100">
<settings>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Customer Since</label>
</settings>
</column>
<column name="website_id" class="MagentoCustomerUiComponentListingColumnWebsites" component="Magento_Ui/js/grid/columns/select" sortOrder="110">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Web Site</label>
</settings>
</column>
<column name="confirmation" class="MagentoCustomerUiComponentListingColumnConfirmation" sortOrder="130">
<settings>
<dataType>select</dataType>
<label translate="true">Confirmed email</label>
<visible>false</visible>
</settings>
</column>
<column name="created_in" sortOrder="140">
<settings>
<label translate="true">Account Created in</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_full" sortOrder="150">
<settings>
<label translate="true">Billing Address</label>
<visible>false</visible>
</settings>
</column>
<column name="shipping_full" sortOrder="160">
<settings>
<label translate="true">Shipping Address</label>
<visible>false</visible>
</settings>
</column>
<column name="dob" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="170">
<settings>
<timezone>false</timezone>
<dateFormat>MMM d, y</dateFormat>
<skipTimeZoneConversion>true</skipTimeZoneConversion>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Date of Birth</label>
<visible>false</visible>
</settings>
</column>
<column name="taxvat" sortOrder="180">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Tax VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="gender" component="Magento_Ui/js/grid/columns/select" sortOrder="190">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Gender</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_street" sortOrder="200">
<settings>
<label translate="true">Street Address</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_city" sortOrder="210">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">City</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_fax" sortOrder="220">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Fax</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_vat_id" sortOrder="230">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_company" sortOrder="240">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Company</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_firstname" sortOrder="250">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Firstname</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_lastname" sortOrder="260">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Lastname</label>
<visible>false</visible>
</settings>
</column>
<column name="lock_expires" class="MagentoCustomerUiComponentListingColumnAccountLock" sortOrder="270">
<settings>
<label translate="true">Account Lock</label>
<visible>false</visible>
</settings>
</column>
<actionsColumn name="actions" class="MagentoCustomerUiComponentListingColumnActions">
<settings>
<indexField>entity_id</indexField>
</settings>
</actionsColumn>
</columns>
</listing>
uicomponent magento-2.2.5 drop-downs
add a comment |
As i said in the post, i wanna know how to create a dropdownlist in ui component, or atleast i need to know how the dropdownlist work, for example, in C:xampphtdocsmagentovendormagentomodule-customerviewadminhtmlui_componentcustomer_listing.xml
.
I wanna make Gender
render 2 column, Male and Female.
And Class
also. Maybe it will render 5 class. Ex: Math, History...
Here is my ui-component:
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing_data_source</item>
</item>
</argument>
<settings>
<buttons>
<button name="add">
<url path="*/*/new"/>
<class>primary</class>
<label translate="true">Add New Customer</label>
</button>
</buttons>
<spinner>customer_columns</spinner>
<deps>
<dep>customer_listing.customer_listing_data_source</dep>
</deps>
</settings>
<dataSource name="customer_listing_data_source" component="Magento_Ui/js/grid/provider">
<settings>
<updateUrl path="mui/index/render"/>
</settings>
<aclResource>Magento_Customer::manage</aclResource>
<dataProvider class="MagentoCustomerUiComponentDataProvider" name="customer_listing_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>entity_id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<listingToolbar name="listing_top">
<settings>
<sticky>true</sticky>
</settings>
<bookmark name="bookmarks"/>
<columnsControls name="columns_controls"/>
<exportButton name="export_button"/>
<filterSearch name="fulltext"/>
<filters name="listing_filters"/>
<massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
<action name="delete">
<settings>
<confirm>
<message translate="true">Are you sure to delete selected customers?</message>
<title translate="true">Delete items</title>
</confirm>
<url path="customer/index/massDelete"/>
<type>delete</type>
<label translate="true">Delete</label>
</settings>
</action>
<action name="subscribe">
<settings>
<url path="customer/index/massSubscribe"/>
<type>subscribe</type>
<label translate="true">Subscribe to Newsletter</label>
</settings>
</action>
<action name="unsubscribe">
<settings>
<confirm>
<message translate="true">Are you sure to unsubscribe selected customers from newsletter?</message>
<title translate="true">Unsubscribe from Newsletter</title>
</confirm>
<url path="customer/index/massUnsubscribe"/>
<type>unsubscribe</type>
<label translate="true">Unsubscribe from Newsletter</label>
</settings>
</action>
<action name="assign_to_group">
<settings>
<type>assign_to_group</type>
<label translate="true">Assign a Customer Group</label>
<actions class="MagentoCustomerUiComponentMassActionGroupOptions"/>
</settings>
</action>
<action name="edit">
<settings>
<callback>
<target>editSelected</target>
<provider>customer_listing.customer_listing.customer_columns_editor</provider>
</callback>
<type>edit</type>
<label translate="true">Edit</label>
</settings>
</action>
</massaction>
<paging name="listing_paging"/>
</listingToolbar>
<columns name="customer_columns" class="MagentoCustomerUiComponentListingColumns">
<settings>
<editorConfig>
<param name="clientConfig" xsi:type="array">
<item name="saveUrl" xsi:type="url" path="customer/index/inlineEdit"/>
<item name="validateBeforeSave" xsi:type="boolean">false</item>
</param>
<param name="indexField" xsi:type="string">entity_id</param>
<param name="enabled" xsi:type="boolean">true</param>
<param name="selectProvider" xsi:type="string">customer_listing.customer_listing.customer_columns.ids</param>
</editorConfig>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing.customer_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
<item name="1" xsi:type="boolean">true</item>
</item>
</param>
</childDefaults>
</settings>
<selectionsColumn name="ids" sortOrder="10">
<settings>
<indexField>entity_id</indexField>
</settings>
</selectionsColumn>
<column name="entity_id" sortOrder="20">
<settings>
<filter>textRange</filter>
<label translate="true">ID</label>
<sorting>asc</sorting>
</settings>
</column>
<column name="name" sortOrder="30">
<settings>
<filter>text</filter>
<label translate="true">Name</label>
</settings>
</column>
<column name="email" sortOrder="40">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Email</label>
</settings>
</column>
<column name="group_id" component="Magento_Ui/js/grid/columns/select" sortOrder="50">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Group</label>
</settings>
</column>
<column name="billing_telephone" sortOrder="60">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Phone</label>
</settings>
</column>
<column name="billing_postcode" sortOrder="70">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">ZIP</label>
</settings>
</column>
<column name="billing_country_id" component="Magento_Ui/js/grid/columns/select" sortOrder="80">
<settings>
<filter>select</filter>
<dataType>select</dataType>
<label translate="true">Country</label>
</settings>
</column>
<column name="billing_region" sortOrder="90">
<settings>
<filter>text</filter>
<label translate="true">State/Province</label>
</settings>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="100">
<settings>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Customer Since</label>
</settings>
</column>
<column name="website_id" class="MagentoCustomerUiComponentListingColumnWebsites" component="Magento_Ui/js/grid/columns/select" sortOrder="110">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Web Site</label>
</settings>
</column>
<column name="confirmation" class="MagentoCustomerUiComponentListingColumnConfirmation" sortOrder="130">
<settings>
<dataType>select</dataType>
<label translate="true">Confirmed email</label>
<visible>false</visible>
</settings>
</column>
<column name="created_in" sortOrder="140">
<settings>
<label translate="true">Account Created in</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_full" sortOrder="150">
<settings>
<label translate="true">Billing Address</label>
<visible>false</visible>
</settings>
</column>
<column name="shipping_full" sortOrder="160">
<settings>
<label translate="true">Shipping Address</label>
<visible>false</visible>
</settings>
</column>
<column name="dob" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="170">
<settings>
<timezone>false</timezone>
<dateFormat>MMM d, y</dateFormat>
<skipTimeZoneConversion>true</skipTimeZoneConversion>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Date of Birth</label>
<visible>false</visible>
</settings>
</column>
<column name="taxvat" sortOrder="180">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Tax VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="gender" component="Magento_Ui/js/grid/columns/select" sortOrder="190">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Gender</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_street" sortOrder="200">
<settings>
<label translate="true">Street Address</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_city" sortOrder="210">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">City</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_fax" sortOrder="220">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Fax</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_vat_id" sortOrder="230">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_company" sortOrder="240">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Company</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_firstname" sortOrder="250">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Firstname</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_lastname" sortOrder="260">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Lastname</label>
<visible>false</visible>
</settings>
</column>
<column name="lock_expires" class="MagentoCustomerUiComponentListingColumnAccountLock" sortOrder="270">
<settings>
<label translate="true">Account Lock</label>
<visible>false</visible>
</settings>
</column>
<actionsColumn name="actions" class="MagentoCustomerUiComponentListingColumnActions">
<settings>
<indexField>entity_id</indexField>
</settings>
</actionsColumn>
</columns>
</listing>
uicomponent magento-2.2.5 drop-downs
add a comment |
As i said in the post, i wanna know how to create a dropdownlist in ui component, or atleast i need to know how the dropdownlist work, for example, in C:xampphtdocsmagentovendormagentomodule-customerviewadminhtmlui_componentcustomer_listing.xml
.
I wanna make Gender
render 2 column, Male and Female.
And Class
also. Maybe it will render 5 class. Ex: Math, History...
Here is my ui-component:
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing_data_source</item>
</item>
</argument>
<settings>
<buttons>
<button name="add">
<url path="*/*/new"/>
<class>primary</class>
<label translate="true">Add New Customer</label>
</button>
</buttons>
<spinner>customer_columns</spinner>
<deps>
<dep>customer_listing.customer_listing_data_source</dep>
</deps>
</settings>
<dataSource name="customer_listing_data_source" component="Magento_Ui/js/grid/provider">
<settings>
<updateUrl path="mui/index/render"/>
</settings>
<aclResource>Magento_Customer::manage</aclResource>
<dataProvider class="MagentoCustomerUiComponentDataProvider" name="customer_listing_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>entity_id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<listingToolbar name="listing_top">
<settings>
<sticky>true</sticky>
</settings>
<bookmark name="bookmarks"/>
<columnsControls name="columns_controls"/>
<exportButton name="export_button"/>
<filterSearch name="fulltext"/>
<filters name="listing_filters"/>
<massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
<action name="delete">
<settings>
<confirm>
<message translate="true">Are you sure to delete selected customers?</message>
<title translate="true">Delete items</title>
</confirm>
<url path="customer/index/massDelete"/>
<type>delete</type>
<label translate="true">Delete</label>
</settings>
</action>
<action name="subscribe">
<settings>
<url path="customer/index/massSubscribe"/>
<type>subscribe</type>
<label translate="true">Subscribe to Newsletter</label>
</settings>
</action>
<action name="unsubscribe">
<settings>
<confirm>
<message translate="true">Are you sure to unsubscribe selected customers from newsletter?</message>
<title translate="true">Unsubscribe from Newsletter</title>
</confirm>
<url path="customer/index/massUnsubscribe"/>
<type>unsubscribe</type>
<label translate="true">Unsubscribe from Newsletter</label>
</settings>
</action>
<action name="assign_to_group">
<settings>
<type>assign_to_group</type>
<label translate="true">Assign a Customer Group</label>
<actions class="MagentoCustomerUiComponentMassActionGroupOptions"/>
</settings>
</action>
<action name="edit">
<settings>
<callback>
<target>editSelected</target>
<provider>customer_listing.customer_listing.customer_columns_editor</provider>
</callback>
<type>edit</type>
<label translate="true">Edit</label>
</settings>
</action>
</massaction>
<paging name="listing_paging"/>
</listingToolbar>
<columns name="customer_columns" class="MagentoCustomerUiComponentListingColumns">
<settings>
<editorConfig>
<param name="clientConfig" xsi:type="array">
<item name="saveUrl" xsi:type="url" path="customer/index/inlineEdit"/>
<item name="validateBeforeSave" xsi:type="boolean">false</item>
</param>
<param name="indexField" xsi:type="string">entity_id</param>
<param name="enabled" xsi:type="boolean">true</param>
<param name="selectProvider" xsi:type="string">customer_listing.customer_listing.customer_columns.ids</param>
</editorConfig>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing.customer_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
<item name="1" xsi:type="boolean">true</item>
</item>
</param>
</childDefaults>
</settings>
<selectionsColumn name="ids" sortOrder="10">
<settings>
<indexField>entity_id</indexField>
</settings>
</selectionsColumn>
<column name="entity_id" sortOrder="20">
<settings>
<filter>textRange</filter>
<label translate="true">ID</label>
<sorting>asc</sorting>
</settings>
</column>
<column name="name" sortOrder="30">
<settings>
<filter>text</filter>
<label translate="true">Name</label>
</settings>
</column>
<column name="email" sortOrder="40">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Email</label>
</settings>
</column>
<column name="group_id" component="Magento_Ui/js/grid/columns/select" sortOrder="50">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Group</label>
</settings>
</column>
<column name="billing_telephone" sortOrder="60">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Phone</label>
</settings>
</column>
<column name="billing_postcode" sortOrder="70">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">ZIP</label>
</settings>
</column>
<column name="billing_country_id" component="Magento_Ui/js/grid/columns/select" sortOrder="80">
<settings>
<filter>select</filter>
<dataType>select</dataType>
<label translate="true">Country</label>
</settings>
</column>
<column name="billing_region" sortOrder="90">
<settings>
<filter>text</filter>
<label translate="true">State/Province</label>
</settings>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="100">
<settings>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Customer Since</label>
</settings>
</column>
<column name="website_id" class="MagentoCustomerUiComponentListingColumnWebsites" component="Magento_Ui/js/grid/columns/select" sortOrder="110">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Web Site</label>
</settings>
</column>
<column name="confirmation" class="MagentoCustomerUiComponentListingColumnConfirmation" sortOrder="130">
<settings>
<dataType>select</dataType>
<label translate="true">Confirmed email</label>
<visible>false</visible>
</settings>
</column>
<column name="created_in" sortOrder="140">
<settings>
<label translate="true">Account Created in</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_full" sortOrder="150">
<settings>
<label translate="true">Billing Address</label>
<visible>false</visible>
</settings>
</column>
<column name="shipping_full" sortOrder="160">
<settings>
<label translate="true">Shipping Address</label>
<visible>false</visible>
</settings>
</column>
<column name="dob" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="170">
<settings>
<timezone>false</timezone>
<dateFormat>MMM d, y</dateFormat>
<skipTimeZoneConversion>true</skipTimeZoneConversion>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Date of Birth</label>
<visible>false</visible>
</settings>
</column>
<column name="taxvat" sortOrder="180">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Tax VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="gender" component="Magento_Ui/js/grid/columns/select" sortOrder="190">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Gender</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_street" sortOrder="200">
<settings>
<label translate="true">Street Address</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_city" sortOrder="210">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">City</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_fax" sortOrder="220">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Fax</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_vat_id" sortOrder="230">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_company" sortOrder="240">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Company</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_firstname" sortOrder="250">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Firstname</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_lastname" sortOrder="260">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Lastname</label>
<visible>false</visible>
</settings>
</column>
<column name="lock_expires" class="MagentoCustomerUiComponentListingColumnAccountLock" sortOrder="270">
<settings>
<label translate="true">Account Lock</label>
<visible>false</visible>
</settings>
</column>
<actionsColumn name="actions" class="MagentoCustomerUiComponentListingColumnActions">
<settings>
<indexField>entity_id</indexField>
</settings>
</actionsColumn>
</columns>
</listing>
uicomponent magento-2.2.5 drop-downs
As i said in the post, i wanna know how to create a dropdownlist in ui component, or atleast i need to know how the dropdownlist work, for example, in C:xampphtdocsmagentovendormagentomodule-customerviewadminhtmlui_componentcustomer_listing.xml
.
I wanna make Gender
render 2 column, Male and Female.
And Class
also. Maybe it will render 5 class. Ex: Math, History...
Here is my ui-component:
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing_data_source</item>
</item>
</argument>
<settings>
<buttons>
<button name="add">
<url path="*/*/new"/>
<class>primary</class>
<label translate="true">Add New Customer</label>
</button>
</buttons>
<spinner>customer_columns</spinner>
<deps>
<dep>customer_listing.customer_listing_data_source</dep>
</deps>
</settings>
<dataSource name="customer_listing_data_source" component="Magento_Ui/js/grid/provider">
<settings>
<updateUrl path="mui/index/render"/>
</settings>
<aclResource>Magento_Customer::manage</aclResource>
<dataProvider class="MagentoCustomerUiComponentDataProvider" name="customer_listing_data_source">
<settings>
<requestFieldName>id</requestFieldName>
<primaryFieldName>entity_id</primaryFieldName>
</settings>
</dataProvider>
</dataSource>
<listingToolbar name="listing_top">
<settings>
<sticky>true</sticky>
</settings>
<bookmark name="bookmarks"/>
<columnsControls name="columns_controls"/>
<exportButton name="export_button"/>
<filterSearch name="fulltext"/>
<filters name="listing_filters"/>
<massaction name="listing_massaction" component="Magento_Ui/js/grid/tree-massactions">
<action name="delete">
<settings>
<confirm>
<message translate="true">Are you sure to delete selected customers?</message>
<title translate="true">Delete items</title>
</confirm>
<url path="customer/index/massDelete"/>
<type>delete</type>
<label translate="true">Delete</label>
</settings>
</action>
<action name="subscribe">
<settings>
<url path="customer/index/massSubscribe"/>
<type>subscribe</type>
<label translate="true">Subscribe to Newsletter</label>
</settings>
</action>
<action name="unsubscribe">
<settings>
<confirm>
<message translate="true">Are you sure to unsubscribe selected customers from newsletter?</message>
<title translate="true">Unsubscribe from Newsletter</title>
</confirm>
<url path="customer/index/massUnsubscribe"/>
<type>unsubscribe</type>
<label translate="true">Unsubscribe from Newsletter</label>
</settings>
</action>
<action name="assign_to_group">
<settings>
<type>assign_to_group</type>
<label translate="true">Assign a Customer Group</label>
<actions class="MagentoCustomerUiComponentMassActionGroupOptions"/>
</settings>
</action>
<action name="edit">
<settings>
<callback>
<target>editSelected</target>
<provider>customer_listing.customer_listing.customer_columns_editor</provider>
</callback>
<type>edit</type>
<label translate="true">Edit</label>
</settings>
</action>
</massaction>
<paging name="listing_paging"/>
</listingToolbar>
<columns name="customer_columns" class="MagentoCustomerUiComponentListingColumns">
<settings>
<editorConfig>
<param name="clientConfig" xsi:type="array">
<item name="saveUrl" xsi:type="url" path="customer/index/inlineEdit"/>
<item name="validateBeforeSave" xsi:type="boolean">false</item>
</param>
<param name="indexField" xsi:type="string">entity_id</param>
<param name="enabled" xsi:type="boolean">true</param>
<param name="selectProvider" xsi:type="string">customer_listing.customer_listing.customer_columns.ids</param>
</editorConfig>
<childDefaults>
<param name="fieldAction" xsi:type="array">
<item name="provider" xsi:type="string">customer_listing.customer_listing.customer_columns_editor</item>
<item name="target" xsi:type="string">startEdit</item>
<item name="params" xsi:type="array">
<item name="0" xsi:type="string">${ $.$data.rowIndex }</item>
<item name="1" xsi:type="boolean">true</item>
</item>
</param>
</childDefaults>
</settings>
<selectionsColumn name="ids" sortOrder="10">
<settings>
<indexField>entity_id</indexField>
</settings>
</selectionsColumn>
<column name="entity_id" sortOrder="20">
<settings>
<filter>textRange</filter>
<label translate="true">ID</label>
<sorting>asc</sorting>
</settings>
</column>
<column name="name" sortOrder="30">
<settings>
<filter>text</filter>
<label translate="true">Name</label>
</settings>
</column>
<column name="email" sortOrder="40">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Email</label>
</settings>
</column>
<column name="group_id" component="Magento_Ui/js/grid/columns/select" sortOrder="50">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Group</label>
</settings>
</column>
<column name="billing_telephone" sortOrder="60">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Phone</label>
</settings>
</column>
<column name="billing_postcode" sortOrder="70">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">ZIP</label>
</settings>
</column>
<column name="billing_country_id" component="Magento_Ui/js/grid/columns/select" sortOrder="80">
<settings>
<filter>select</filter>
<dataType>select</dataType>
<label translate="true">Country</label>
</settings>
</column>
<column name="billing_region" sortOrder="90">
<settings>
<filter>text</filter>
<label translate="true">State/Province</label>
</settings>
</column>
<column name="created_at" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="100">
<settings>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Customer Since</label>
</settings>
</column>
<column name="website_id" class="MagentoCustomerUiComponentListingColumnWebsites" component="Magento_Ui/js/grid/columns/select" sortOrder="110">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Web Site</label>
</settings>
</column>
<column name="confirmation" class="MagentoCustomerUiComponentListingColumnConfirmation" sortOrder="130">
<settings>
<dataType>select</dataType>
<label translate="true">Confirmed email</label>
<visible>false</visible>
</settings>
</column>
<column name="created_in" sortOrder="140">
<settings>
<label translate="true">Account Created in</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_full" sortOrder="150">
<settings>
<label translate="true">Billing Address</label>
<visible>false</visible>
</settings>
</column>
<column name="shipping_full" sortOrder="160">
<settings>
<label translate="true">Shipping Address</label>
<visible>false</visible>
</settings>
</column>
<column name="dob" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date" sortOrder="170">
<settings>
<timezone>false</timezone>
<dateFormat>MMM d, y</dateFormat>
<skipTimeZoneConversion>true</skipTimeZoneConversion>
<filter>dateRange</filter>
<dataType>date</dataType>
<label translate="true">Date of Birth</label>
<visible>false</visible>
</settings>
</column>
<column name="taxvat" sortOrder="180">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Tax VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="gender" component="Magento_Ui/js/grid/columns/select" sortOrder="190">
<settings>
<filter>select</filter>
<editor>
<editorType>select</editorType>
</editor>
<dataType>select</dataType>
<label translate="true">Gender</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_street" sortOrder="200">
<settings>
<label translate="true">Street Address</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_city" sortOrder="210">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">City</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_fax" sortOrder="220">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Fax</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_vat_id" sortOrder="230">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">VAT Number</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_company" sortOrder="240">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Company</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_firstname" sortOrder="250">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Firstname</label>
<visible>false</visible>
</settings>
</column>
<column name="billing_lastname" sortOrder="260">
<settings>
<filter>text</filter>
<editor>
<editorType>text</editorType>
</editor>
<label translate="true">Billing Lastname</label>
<visible>false</visible>
</settings>
</column>
<column name="lock_expires" class="MagentoCustomerUiComponentListingColumnAccountLock" sortOrder="270">
<settings>
<label translate="true">Account Lock</label>
<visible>false</visible>
</settings>
</column>
<actionsColumn name="actions" class="MagentoCustomerUiComponentListingColumnActions">
<settings>
<indexField>entity_id</indexField>
</settings>
</actionsColumn>
</columns>
</listing>
uicomponent magento-2.2.5 drop-downs
uicomponent magento-2.2.5 drop-downs
edited 11 mins ago
Teja Bhagavan Kollepara
2,94841847
2,94841847
asked Jul 28 '18 at 9:11
fudufudu
37411
37411
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f236330%2fmagento-2-2-5-how-to-create-dropdownlist-in-ui-component%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f236330%2fmagento-2-2-5-how-to-create-dropdownlist-in-ui-component%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown