Loading ...
Sorry, an error occurred while loading the content.

I am not able to get Waiting Image working in my Datatable .

Expand Messages
  • myworld100us
    I am trying to display Waiting image while the datatable is loading . It doesn t seem to work . Though I can check by alerts and stuff the function is getting
    Message 1 of 1 , May 5, 2008
    • 0 Attachment
      I am trying to display Waiting image while the datatable is loading .
      It doesn't seem to work . Though I can check by alerts and stuff the
      function is getting called . Can anyone help me .I use yui 2.4.1

      I think I am doing something wrong with render function .




      var loadingTableQueue = 0;
      var waitingDiv; //**the div to show waiting status, the hourglass so
      to speak

      function displayWaitingNew(){
      alert('displayWaiting1');
      if(loadingTableQueue==0){

      waitingDiv = new YAHOO.widget.Panel("waitingTest",
      { width:"240em",
      visible:true,

      effect:{effect:YAHOO.widget.ContainerEffect.FADE, duration:0.5}
      }
      );

      waitingDiv.setHeader("Loading, please wait...");
      //alert('displayWaiting2');
      waitingDiv.setBody('Hi Terry');
      //alert('displayWaiting3');
      waitingDiv.render(document.body);
      alert('displayWaiting4'+waitingDiv);
      }
      loadingTableQueue++; //increment the number of table
      waiting for data
      //alert('exit displaywaiting');
      }//end function displayWaiting

      function loadTable()
      {
      // YUI for Loading dt
      displayWaitingNew();//Call Progress indicator

      //Hide the Image one datatable is loaded
      myDataTable.subscribe("initEvent",
      function(request, response, callback, caller, id)
      {

      if(loadingTableQueue>0){
      //alert('Decresing the loadingtableQueue');
      loadingTableQueue--;
      //alert(loadingTableQueue);
      if(loadingTableQueue==0){
      //alert('Before hiding waiting div');
      //waitingDiv.cfg.setProperty("visible",true);
      //alert('After hiding waiting div');
      }
      }

      }


      );


      }


      <div id="datatable"/>
      <div id="waitingTest"/>
    Your message has been successfully submitted and would be delivered to recipients shortly.