List

토요일, 5월 07, 2016

Ajax 통신중 .. progress cicle 만들기


  • 결과값을 받아오기전에 진행중 progress 띄우기..
    • beforeSend 함수로 progress를 보여주고
    • done함수로 숨겨주면 
    • 끗! 정말쉽다

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
         $.ajax({
            url:"${path}/visor/ownerSch",
            data:ownerSchData,
            dataType:"html",
            method: 'post',
            beforeSend:function(){
                $("#owner-progress-circle").show();
            },
            success:function(data){
                    
                    //page 자체를 받아서 div에 넣는식
                    $("#ownerList").html(data);
                
            },error:function(request,status,error){
                 alert("code:"+request.status+"\n"+"message:"
                 +request.responseText+"\n"+"error:"+error);
             }
        }).done(function() {
            //받아오는 속도가 너무빨라서 억지로 보여주는 상황..
            setTimeout(function(){
                $("#owner-progress-circle").hide();
            } ,200);
            
            //진행중 원세팅
            setProgressCicle($("#owner-table"), $("#owner-progress-circle"), 30);
            
        });
cs

댓글 없음:

댓글 쓰기