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

Is it possible to show ajax loading panel using js ?

1 Answer 97 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
IT Services
Top achievements
Rank 1
IT Services asked on 26 Feb 2009, 06:34 PM
Hi,
Is it possible to show ajax loading panel using js?
Let's say I want to start some heavy client side operation (not ajax call), and I would like to indicate user that something is going on.
For example:
 
function heavyAction() { 
   ShowLoadingPanel(true); 
 
   Do some stuff .. 
   ... 
   ... 
 
   ShowLoadingPanel(false); 
 
function ShowHideLoadingPanel(show) { 
   var objGrid = $find("<%= RadGrid1.ClientID %>");  
   var objLoadPanel =$get("<%= RadAjaxLoadingPanel1.ClientID %>"); 
   if (show) { 
      objLoadPanel.style.height = document.documentElement.scrollHeight + "px"
      objLoadPanel.show(objGrid._masterClientID); 
   } 
   else 
      objLoadPanel.hide(objGrid._masterClientID); 
   }       
You can see from above that I tried something along showing hiding without much success, any thoughts?

Regards
Luka




1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 04 Mar 2009, 10:36 AM
Hello,

Please try the following approach:
<script type="text/javascript" language="javascript"
    function Test_RegEx() 
    { 
        var startTime = new Date(); 
        var str = 'cdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbzcdbbdbsbz'
        for (i = 0; i <= 300000; i++) 
        { 
            myRe = /d(b+)d/g; 
            myArray = myRe.exec(str); 
        } 
        return (new Date() - startTime); 
    } 
    function ajaxTest() 
    { 
        var panel = $find('<%= RadAjaxLoadingPanel1.ClientID  %>'); 
        panel.show("button1"); 
        setTimeout(function() { return Test_RegEx(); }, 1000); 
        setTimeout(function() { panel.hide("button1"); }, 2000); 
    } 
</script> 

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
IT Services
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or