0

テーブルを表示するために、単純なモーダルウィンドウダイヤルポップアップを使用しています。このテーブルのセルをクリックすると、別のjqueryダイアログボックスが表示され、このポップアップに別のテーブル(動的コンテンツ)が表示されます。問題は、最初にアクセスしたときにdilaogが正常に表示されるが、google chrome(バージョン19.0.1084.56 m)では2回目は機能せず、mozilla(13.0.1)では正しく機能することです。

  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   
4

1 に答える 1

0

$("#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);  

      });
 }

インデントを修正してください。コードを見るのはつらいです:)

于 2012-06-29T07:42:29.750 に答える