Magento2 Add css class to admin ui grid column
-
11-05-2021 - |
Question
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?
Solution
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>
OTHER TIPS
<column name="your_column">
<settings>
<label translate="true">Your Column</label>
<fieldClass>
<class name="your_css_class">true</class>
</fieldClass>
</settings>
</column>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange