0

I want to add a custom CSS class to the ui_component listing table. The listing table is created as follows:

<?xml version="1.0" encoding="UTF-8"?>
<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">aw_helpdesk2_ticket_frontend_listing.aw_helpdesk2_ticket_frontend_listing_data_source</item>
        </item>
    </argument>
    <settings>
        <spinner>aw_helpdesk2_ticket_columns</spinner>
        <deps>
            <dep>aw_helpdesk2_ticket_frontend_listing.aw_helpdesk2_ticket_frontend_listing_data_source</dep>
        </deps>
    </settings>

I tried adding

<item name="config" xsi:type="array">
    <item name="fieldClass" xsi:type="string">custom-class</item>
</item>

But it is not working

1 Answer 1

0

try below code

<item name="additionalClasses" xsi:type="array">
     <item name="custom_class" xsi:type="boolean">true</item>
</item>

Column field

<field name="home_preference_sequence">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">337</item>
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="label" translate="true" xsi:type="string">Home Preference Sequence</item>
                    **<item name="additionalClasses" xsi:type="array">
                        <item name="admin__field_home_preference_sequence" xsi:type="boolean">true</item>
                    </item>**
                </item>
            </argument>
        </field>
2
  • I added this inside <argument> and ran commands but not working
    – GenZ Dev
    May 21, 2021 at 10:24
  • Magento allows to add of CSS for column or field
    – Devidas
    May 21, 2021 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.