cancelRequest and Chrome

Thread is closed for posting
4 posts, 0 answers
  1. Basel Nimer
    Basel Nimer avatar
    94 posts
    Member since:
    Oct 2009

    Posted 04 May 2010 Link to this post

    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.



  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 06 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Basel Nimer
    Basel Nimer avatar
    94 posts
    Member since:
    Oct 2009

    Posted 06 May 2010 Link to this post

    I see, so is there a way to hide the cancel button when it is not functioning.

  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 11 May 2010 Link to this post

    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.
Back to Top