how to disable ejs button if i not select any file in browse button(ejs-uploader) - Branched from 175630

Hello,


I want to disabled and enabled control (ejs-uploader) based on condition. I need two way binding like this

        <ejs-uploader #fileUploader [dropArea]='dropElement' id="ejs-uploader-{{this.controlId}}"
          [disabled]="trueConditon" [multiple]="isAllowMultipleFiles">
        </ejs-uploader>

1 Reply

VY Vinothkumar Yuvaraj Syncfusion Team November 30, 2022 03:24 PM UTC

Hi Ishani Shah,


We suggest using the enabled property to enable or disable the uploader based on conditions. In the below sample, we disabled or enabled the uploader component by clicking the button. Please find the sample here for your reference.

app.component.html

 <ejs-uploader

        #defaultupload

        id="defaultfileupload"

        [enabled]="enable"

      >

      </ejs-uploader>


Sample :https://stackblitz.com/edit/angular-orfxat?file=app.component.html,app.component.ts


API : https://ej2.syncfusion.com/angular/documentation/api/uploader/#enabled


Regards,

Vinothkumar


Loader.
Up arrow icon