i try this code but it not working with tab in form ui component:
<item name="additionalClasses" xsi:type="array">
<item name="my-custom-class" xsi:type="boolean">true</item>
</item>
-
1what you want to exactly?Rutvee Sojitra– Rutvee Sojitra2019年05月24日 10:15:06 +00:00Commented May 24, 2019 at 10:15
-
i want add class to my custom tab in form ui component?NewBie– NewBie2019年05月24日 10:17:30 +00:00Commented May 24, 2019 at 10:17
-
Do you want to additionClass for form filed or left side custom tab?Rutvee Sojitra– Rutvee Sojitra2019年05月24日 10:57:03 +00:00Commented May 24, 2019 at 10:57
-
left side custom tabNewBie– NewBie2019年05月24日 10:58:04 +00:00Commented May 24, 2019 at 10:58
2 Answers 2
Try this code to add additonalclasses for tab in form ui component.
More information in details, Visit, How to additonalClasses for Tab in Magento 2 UI component form
<fieldset name="address" sortOrder="30">
<settings>
<additionalClasses>
<class name="custom-address">true</class>
</additionalClasses>
</settings>
</fieldset>
Hope this helps. Thanks.
answered May 24, 2019 at 19:59
Prashant Patel
1,29711 silver badges22 bronze badges
Try using following example:
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="websites" sortOrder="30">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="additionalClasses" xsi:type="string">admin__field-medium</item>
</item>
</argument>
</fieldset>
</form>
answered May 24, 2019 at 10:49
Sohel Rana
36.2k3 gold badges74 silver badges94 bronze badges
-
It does not working with Magento 2.3 :(NewBie– NewBie2019年05月24日 10:54:19 +00:00Commented May 24, 2019 at 10:54
-
This is tested code in 2.3 :) Makesure you use this correctlySohel Rana– Sohel Rana2019年05月24日 10:55:09 +00:00Commented May 24, 2019 at 10:55
-
I tried it but nothing happenedNewBie– NewBie2019年05月24日 10:56:21 +00:00Commented May 24, 2019 at 10:56
-
Your answer is right @SohelRana but it's for form filed... it want for custom left tabRutvee Sojitra– Rutvee Sojitra2019年05月24日 10:59:08 +00:00Commented May 24, 2019 at 10:59
-
yes, I apologize for not clarifyingNewBie– NewBie2019年05月24日 11:01:20 +00:00Commented May 24, 2019 at 11:01
default