Can we remove image preview from ui fileuploader?

38 Views Asked by At

Is it possible to remove image preview from UI fileuploder component, without using file component?

here is my code=>

 <field name="file">
         <argument name="data" xsi:type="array">
          <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">string</item>
            <item name="source" xsi:type="string">TestGroup</item>
            <item name="label" xsi:type="string" translate="true">File</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="formElement" xsi:type="string">fileUploader</item>
            <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
            <item name="previewTmpl" xsi:type="string">Vendor_Module/image-preview</item>
            <item name="required" xsi:type="boolean">false</item>
            <item name="sortOrder" xsi:type="number">40</item>
            <item name="uploaderConfig" xsi:type="array">
                <item name="url" xsi:type="url" path="controller/index/upload"/>
            </item>
      </argument>
    </field>

tried by removing item name= elementTmpl and previewTmpl but not working can anybody help me to disable the image preview for fileupload.

Thanks in Advance.

1

There are 1 best solutions below

0
LitExtension Magento Migration On

Remove the src of image every time you click:

$("#input1").click(function () {    
    $('#imagepreview1').attr('src','');
});