Whenever I try to click on cancel button 'during' a file upload, the ProgressArea doesn't disappear. Is there any way where I can either programatically disable/hide the cancel button during the upload or hide the ProgressArea after clicking on the cancel button.
I tried using the following code:
function onClientProgressUpdating()
{
$telerik.$(".ruCancel").hide();
}
function onClientFileUploaded()
{
$telerik.$(".ruCancel").show();
}
4 Answers, 1 is accepted
If you are trying to hide the RadProgressArea here's how you can do it:
var
area = $find(
'<%=RadProgressArea1.ClientID%>'
);
area.get_element().style.display =
"none"
;
You can hide the Cancel button using hide() but showing it in the onClientFileUploaded event handler is not possible, because the button is added dynamically when a file is selected for upload and removed when the file is uploaded. It can be visible only during the file upload.
Regards,
Ivan Danchev
Telerik
Hi Ivan,
I tried to cancel the ongoing upload in IE10,11 and Chrome, where the functionality was working fine and as expected the Progress Area disappears. But in the case of IE9 even in the compatibility view, the progress area still shows even fter the clicking on the cancel button.
Also,
I have tried to hide the Progress Area using the above code also, which works, but later on when I upload a file it doesnt show at all.
Regards
Phanish
I am afraid we were not able to reproduce this behavior with the ProgressArea not disappearing when you cancel an upload in IE9. Could you please try uploading/cancelling the upload in this demo and check if you can reproduce the issue?
On showing the ProgressArea, once you've hidden it if you want to show it when the user starts uploading another file you can subscribe to the RadAsyncUpload's OnClientFileSelected client-side event and show the ProgressArea in its handler:
function
OnClientFileSelected(sender, args) {
var
area = $find(
'<%=RadProgressArea1.ClientID%>'
);
area.get_element().style.display =
"block"
;
}
Regards,
Ivan Danchev
Telerik