2012-06-29 6 views
0

간단한 모달 창 다이얼을 사용하여 테이블을 표시합니다. 이 테이블의 셀을 클릭하면 다른 jquery 대화 상자 팝업이 나타나고이 팝업에서 다른 테이블 (동적 내용)을 보여줍니다. 이제 문제는 내가 그들에게 처음 접근하지만, 구글 크롬에서 두 번째로 작동하지 않습니다 (버전 19.0.1084.56 m)를 모질라에서 제대로 작동하고 때 모두 (13.0.1)jquery 대화 상자가 두 번째로 나타나지 않습니다 ........?

I am giving some code snippet if there is something wrong plz help me.... 
//my first function which creates simple modal dialog on which i am writing content of another page dash.jsp (creating table) 
     // Maptrans.jsp page 
     function clicker1(){ 
          alert("modal1"); 
        var divString="<table>"+ 
       "<tr>"+ 
           "<td> 
            <table> 
             <div id='dash'></div> 
            </table> 
          </td>"+ 
         "</tr> 
       </table>"; 
         alert("modal2"); 
         $("#basic-modal-content").html(divString); 
         $("#basic-modal-content").modal(); 
         alert("modal3"); 


    //Getting data of dash.jsp and write on dash div 
       $.post("dash.jsp",function(data){ 
         $("#dash").html(data); 
       }); 

// dash.jsp function called when i will click on cell of first table 
    function access(test1,facilityName,status){ 
     alert("dialog1"); 
var divString="<table>"+ 
         "<tr>"+ 
          "<td > 
           <div id='rfidMove'><img src='img/basic/loader0.gi/></div> 
         </td>"+ 
     "</tr> 
       </table>"; 

      alert("dialog2"); 

$("#rfi").html(divString); 

$("#rfi").dialog({ 
      width: '650', 
      height: '500', 
      zIndex : '3000', 
      modal:true, 
      title: "RFID INVENTORY DETAIL", 
      overlay: { opacity: 0.1, background: 'black'}, 
      open: function(event, ui) { 
       $("#rfidMove").css("display", ""); 
      }, 
      close: function(event, ui){ 

      $("#rfi").dialog('destroy'); 

      } 
    }); 

    alert("dialog3"); 


    $.post("RfidInventory.jsp?","container="+test1+"&facilityName="+facilityName+"&status="+status, function(data){ 

     alert("dialog4"); 

     $("rfidMove").css("display","none"); 
     $("#rfi").html(data); 

     }); 
} 


// In both function i am getting alert before creation of dialog but after dialog creation code not.... 
I have spent alot of time to figure it out but unable to found any solution plz help ... Thanks 

답변

0

그것을인가 잘 올 dilaog입니다 대화 상자가 닫힐 때마다 $("#rfi").dialog('destroy');에 필요합니까?
다른 곳에서는 한 번 대화 상자를 만드는 것이 더 좋습니다 (예 : jquery.ready().open()).

편집 :
아마, 당신은 다음과 같이해야합니다 :

$(function(){ 
    //construct dialog once in jquery.ready() 
    $("#rfi").dialog({ 
      width: 650, 
      height: 500, 
      zIndex : 3000, 
      modal:true, 
      title: "RFID INVENTORY DETAIL", 
      overlay: { opacity: 0.1, background: 'black'}, 
      open: function(event, ui) { 
       $("#rfidMove").css("display", ""); 
      } 
    }); 
}) 

...

function access(test1,facilityName,status){ 
     alert("dialog1"); 
     var divString="<table>"+ 
         "<tr>"+ 
          "<td > 
           <div id='rfidMove'><img src='img/basic/loader0.gi/></div> 
         </td>"+ 
     "</tr> 
       </table>"; 

      alert("dialog2"); 

$("#rfi").html(divString); 

    //reuse already created dialog 
    $("#rfi").dialog('open'); 

    alert("dialog3"); 


    $.post("RfidInventory.jsp?","container="+test1+"&facilityName="+facilityName+"&status="+status, function(data){ 

     alert("dialog4"); 

     $("rfidMove").css("display","none"); 
     $("#rfi").html(data); 

     }); 
} 

를 당신에게 들여 쓰기를 바랍니다 고정한다. 코드를 보면 고통 스럽습니다.

+0

더 많은 정보를 알려주세요 ..... – vips

+0

@vips, 내 대답을 편집했습니다. 확인 해봐. – Niemand

관련 문제