5

I need to add some css rules to one of the columns of my custom admin ui grid. Is there a way to add css class to it from listing xml file?

2 Answers 2

9

Sure, just add "fieldClass" property to the column configuration:

<column name="column_name">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="fieldClass" xsi:type="string">your-css-rule(s)</item>
        </item>
    </argument>
</column>
2
  • How about if you want a dynamic class based on the value or just the value of the column? Commented May 21, 2019 at 8:16
  • working perfect Thanks @V Korotun Commented May 31, 2022 at 12:49
3
<column name="your_column">
    <settings>
        <label translate="true">Your Column</label>
        <fieldClass>
            <class name="your_css_class">true</class>
        </fieldClass>
    </settings>
</column>

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.