Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Jquery process status box

Posted on 2012-09-12
3
Medium Priority
?
253 Views
Last Modified: 2012-09-13
Running into trouble making my page show a processing status on longer winded processes.  The processes dominate and the status cell never has a chance to display.

How can I make the status fade in  work before the show begins?


      $('#WfEmpId').blur(function()
      {
            $('#status').fadeIn();            
            //Populates Name, Pay Assgn List and Period List  GOTO:  TOWBFORM/js/fetch-handlers.js:10     fetch and display Name, Active Pay Assgs, and Active Pay Periods  
            $().fetch_hr_pemaster({      
            'empid' : $("#WfEmpId").val()
            
            });
            
            loadPreviousPer();   //GOTO: loadpreviousperiod.js
            loadCurrentPer();    //GOTO: loadcurrentperiod.js
            $('#status').fadeOut();
      });
0
Comment
Question by:KeithMcElroy
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Steve Krile earned 2000 total points
ID: 38394304
$.fadeIn() has two optional parameters:  speed, and callback.  So you could do something like this - where your populate function is triggered *after* the fadeIn event:

    $("#status").fadeIn("fast", function(){  
            //Populates Name, Pay Assgn List and Period List  GOTO:  TOWBFORM/js/fetch-handlers.js:10     fetch and display Name, Active Pay Assgs, and Active Pay Periods   
            $().fetch_hr_pemaster({       
            'empid' : $("#WfEmpId").val()
    });

Open in new window

0
 

Author Comment

by:KeithMcElroy
ID: 38394705
this works really well.  I am fading out at the last line within the fadeIn and that seems to work.
However, new at this, is that the best place to put the fadeOut?
Will award points, just wanted to ask this follow up ?
Thanks a mil!
0
 
LVL 16

Expert Comment

by:Steve Krile
ID: 38394737
Well, it depends - does loadCurrentPer(); or loadPreviousPer();  take a while?  If so, you may consider sticking the fadeOut() at the end of those processes.  Javascript has a preference to plow through every line of code and doesn't necessarily wait for the last line to execute before doing the next - especially if your load functions are doing ajax work.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question