This is a migrated thread and some comments may be shown as answers.

cancelRequest and Chrome

3 Answers 36 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Basel Nimer
Top achievements
Rank 2
Basel Nimer asked on 04 May 2010, 09:56 AM
Hello,

I am using the following code in order to give user the ability to cancel uploading a file, while giving the developer the ability to do more actions:

        $telerik.$(".ruCancel", area.get_element()).click 
        ( 
            function(e)  
            { 
                return CancelUpload(); 
            } 
        );   
 
 
//---------------------- 
 
    function CancelUpload() 
    { 
        area.cancelRequest(); 
        alert('canceled');
        return false;    
    }        


what happens is that the alert is executed, which leads to the assumption that the cancelReuest was also executed, but the browser status bar still shows that the file is under upload !!!!

this only happens when using Chrome.



3 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 06 May 2010, 02:25 PM
Hello Basel Nimer,

The CancelRequest functionality does not work under Chrome and Safari. This is due to a WebKit restriction that no JavaScript can be executed after form submission. This problem is one of the limitations of RadProgressArea is enlisted here.

Kind regards,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Basel Nimer
Top achievements
Rank 2
answered on 06 May 2010, 02:54 PM
I see, so is there a way to hide the cancel button when it is not functioning.

0
Genady Sergeev
Telerik team
answered on 11 May 2010, 06:20 PM
Hello Basel Nimer,

You can use the following code in order to hide the cancel button under Safari and Chrome:

<script type="text/jscript">
        function clientClick() {
            function callBack() {
                var area = $find("RadProgressArea1");
                $telerik.$(".ruCancel", area.get_element()).hide();           
            }
 
            if ($telerik.isSafari) {
                setTimeout(callBack, 1000);
            }
        }
         
     
    </script>
 
    <telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
    <telerik:RadUpload runat="server" ID="RadUpload1" AllowedFileExtensions=".jpeg, .jpg">
    </telerik:RadUpload>
    <telerik:RadProgressArea runat="server" ID="RadProgressArea1" DisplayCancelButton="true">
    </telerik:RadProgressArea>
    <asp:Button runat="server" ID="UploadButton" Text="Postback"  OnClientClick="clientClick();" />

The clientClick function is invoked when one click on the upload button.

Regards,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Upload (Obsolete)
Asked by
Basel Nimer
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Basel Nimer
Top achievements
Rank 2
Share this question
or