BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi!
I would like to disable the clear button in the SfUploader component programmatically from a method that I created. Is that possible? If so, how can I achieve that?
Thanks in advance.
Yes, you are able to disable the Clear button of the File Upload component from another method using JS Interop, as shown in the code snippet below.
[Index.js]
@using Syncfusion.Blazor.Inputs @using System.IO @inject IJSRuntime JSRuntime
<div style="margin:130px auto;width:300px"> <button class="e-btn" @onclick="DiableClearButton">Disable Clear Button</button> <br /> <SfUploader ID="UploadFiles" AutoUpload="false"></SfUploader> </div>
@code{ public async Task DiableClearButton() { await JSRuntime.InvokeAsync<object>("disableButton"); } } |
[Script]
function disableButton() { document.getElementsByClassName('e-file-clear-btn')[0].disabled = true; } |