Re-Enable uploader browse button after some action has been fulfilled

Hello, I have 2 uploader in the same page.
I Already implemented disable browse button for the second upload button..
I want to re-enable it after the first upload have been successfully commited.
can you tell me how? Maybe via javascript or anything. My assumption is adding some code on the OnSuccess action, but I dont know what to add.

@Html.EJS().Uploader("UploadFiles2").DropArea(".control-fluid").Failure("onUpFail").Removing("onFileRemove").Success("OnSuccess").Enabled(false).AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = @Url.Content("~/ATDLookup/Uploader"), RemoveUrl = @Url.Content("~/ATDLookup/Remove") }).Render()

Notice the id is UploadFiles2 since the first one is on the other line of code

Thankyou


1 Reply 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team March 31, 2022 02:55 AM UTC

Hi,


We have prepared sample as per your requirement, to enable the browser button on success of the first uploader.


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion_MVC-1825715781


@Html.EJS().Uploader("UploadFiles1").AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = https://ej2.syncfusion.com/services/api/uploadbox/Save, RemoveUrl = https://ej2.syncfusion.com/services/api/uploadbox/Remove }).AutoUpload(false).CssClass("Upload1").Success("OnSuccess").Render()

 

@Html.EJS().Uploader("UploadFiles2").AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = https://ej2.syncfusion.com/services/api/uploadbox/Save, RemoveUrl = https://ej2.syncfusion.com/services/api/uploadbox/Remove }).AutoUpload(false).CssClass("Upload2").Created("OnCreate").Render()

 

<script>

    function OnCreate() {

        document.querySelector(".Upload2").querySelector(".e-css.e-btn").classList.add("e-disabled");

        document.querySelector(".Upload2").querySelector(".e-css.e-btn").style.pointerEvents = "none";

    }

    function OnSuccess() {

        debugger

        console.log("Syuce")

        document.querySelector(".Upload2").querySelector(".e-css.e-btn").classList.remove("e-disabled");

        document.querySelector(".Upload2").querySelector(".e-css.e-btn").style.pointerEvents = "none";

    }

</script>


Regards,

Ponmani M


Marked as answer
Loader.
Up arrow icon