BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
It is possible to clear all file entries from by using ClearAllAsync method
https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfUploader.html#Syncfusion_Blazor_Inputs_SfUploader_ClearAllAsync
Is there a way to clear only success messages from the list, but not removing error messages and the files still waiting in the upload queue?
Thanks & Kind regards
Hi Yunus,
Query 1: It is possible to clear all file entries from by using ClearAllAsync method:
We cannot clear the file entries in the saved location when called the clearAllAsync method we can clear only the rendered file list of the uploader component.
Query 2: Is there a way to clear only success messages from the list, but not removing error messages and the files still waiting in the upload queue?
We have achieved your requirement by using the JSIntrop.
Find the code example here:
[index.razor] <div class="target">
<SfUploader @ref="uploadObj" ID="UploadFiles" AutoUpload="false" DropArea=".target"> <UploaderAsyncSettings SaveUrl="api/SampleData/Save" RemoveUrl="api/SampleData/Remove"></UploaderAsyncSettings> <UploaderEvents Success="OnSuccess" ></UploaderEvents> </SfUploader> </div> @code { SfUploader uploadObj;
[Inject] protected IJSRuntime JsRuntime { get; set; }
public string customHeader { get; set; } = "";
public void OnSuccess(Syncfusion.Blazor.Inputs.SuccessEventArgs args) { JsRuntime.InvokeVoidAsync("onListClear", args); } } |
[RemoveFileList.js]
window.onListClear = (id) => { var fileListElement = document.querySelectorAll(".e-upload-file-list"); for (var count = 0; count <= fileListElement.length; count++) { var fileNameList = fileListElement[count].getAttribute("data-file-name"); if (fileNameList === id.file.name) { fileListElement[count].remove(); } } }
|
Find the sample in the attachment:
Regards,
Sureshkumar P
Hi
Sureshkumar,
Thanks for the offered solution. It works great.
Kind regards
We
are glad the suggestion helped you to achieve your requirement. Please
let us know if you need further assistance.