0

I added new thumbnail grid in UI grid.

<column name="mimage" class="Vendor\Slider\Ui\Component\Listing\Column\MobileImage">
 <argument name="data" xsi:type="array">
 <item name="config" xsi:type="array">
 <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/thumbnail</item>
 <item name="sortable" xsi:type="boolean">false</item>
 <item name="altField" xsi:type="string">name</item>
 <item name="has_preview" xsi:type="string">1</item>
 <item name="label" xsi:type="string" translate="true">Mobile Image</item>
 </item>
 </argument>
</column>

Then I try folowing argumnets but it's not work

<item name="resizeEnabled" xsi:type="boolean">true</item>
<item name="resizeDefaultWidth" xsi:type="string">60</item>

Also try

<argument name="width" xsi:type="string">150px</argument>

But it displays default width.

Any help appreciated.

asked Aug 19, 2017 at 5:49
2
  • Have you check using deploy command and clear browser cache? Commented Aug 19, 2017 at 6:09
  • I'm using developer mode so I thing I need not run deploy Commented Aug 19, 2017 at 6:12

1 Answer 1

1

Resize can be switched on for any listing column like this:

<column name="creation_time">
 <argument name="data" xsi:type="array">
 <item name="config" xsi:type="array">
 <item name="resizeEnabled" xsi:type="boolean">true</item>
 <item name="resizeDefaultWidth" xsi:type="string">60</item>
 </item>
 </argument>
</column>

If above not working use below best way.

Update width parameter from CSS or .less file of adminhtml theme

.data-grid .data-grid-thumbnail-cell img {
 border: 1px solid #d6d6d6;
 width: /*change per your wish*/;
}
Pratik Mehta
3801 gold badge3 silver badges16 bronze badges
answered Dec 6, 2017 at 11:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.