English 中文(简体)
• 如何重新签署“平等对话”会议
原标题:How to re-assign jQueryUI Dialog close button event

基本上,我以人工方式展示和隐藏迪亚洛,把像头盔工程这样的东西放在一起(老问他,多载热控制——不能隐蔽使用或闪电......这样,我就能够展示/h。

So i set autoOpen: to true so when the page loads its not prehidden... and I just use jquery css to hide it with positioning and then hide its overlay with display:none; (versus a css file since i need to override style="" elements) ... and now i want to hide it...

但是,Dialog自动拆解的近海纽州自动标明了自己的密切功能,并显示:无。 我想推翻这一立场......

关于如何重新分配的想法? 我认为,这次点击事件没有约束力,并重新加以分配。 i 不能说是真正做到的最好办法。

感谢任何想法:

最佳回答

你们可以与近日活动挂钩,并在此逻辑上:

$( #dialogID )
        .dialog({ 
            autoOpen: true
        }).bind( dialogclose , function(event, ui) { /* Do position logic here */ });

我对这部法典进行了测试,这样就无法确定,你是否要用人工叫 close,以掩盖辩词。 如果在此行文中添加:

$( #dialogID ).dialog("close");

人们还记得,如果X在方言右上角被点击,这一密切功能也将被称作。

问题回答

这有助于我走上轨道:

i did: my html:

<body>  
  <div id="popup">
    Please upload the files you want associated with this payment below:
    <span id="dialog_file_upload_btn"></span>
  </div>

  <div>
    <a id="attach_1" href="#" class="upload_file">Attach</a>
    ....
    <a id="attach_2" href="#" class="upload_file">Attach</a>
    ...
    <a id="attach_3" href="#" class="upload_file">Attach</a>
  </div>
</body>  

我的 c:

  .ui-widget-overlay{ 
    display: none;  
  }
  .ui-dialog{ /*need to override style="" with jquery. this is just for reference */
    top: -5000px;  
  } 

我的 j:

function closeDialog(){
  $( .ui-dialog ).css( top , -5000);
  $( .ui-widget-overlay ).css( display , none );
}

var swfu;
var dialog;
var orig_top_css;

$(document).ready (function()
{


    dialog = $( #popup ).dialog({
      closeOnEscape: false,
      modal: true,
      title:  Upload File(s) related to this row 

    }).bind( dialogbeforeclose , function(event, ui) { 
      closeDialog();
      return false;
    });

    orig_top_css = $( .ui-dialog ).css( top ); //get after dialog created, possibly see if oncomplete function. but this stores origial  centered  value


    var settings =
    {
        flash_url:  scripts/swfupload/Flash/swfupload.swf? +Math.random(),
        ...

      upload_success_handler: function() { console.log ( success ); alert( You have successfully uploaded the file(s). ); dialog.dialog( close ); }, //catches close and doesnt really close in my dialogbeforeclose event
      upload_progress_handler: function(file, complete, total) { console.log ( progress  + file + " " + complete + " " + total); }

      ,prevent_swf_caching : true
      ,post_params: {payment_id:  value1 }

    };

    swfu = new SWFUpload (settings);

    $( .upload_file ).click(function() {                              
      orig_top_css_wopx = parseInt( orig_top_css.replace( px ,  ) ,10);

      $( .ui-dialog ).css( top , orig_top_css_wopx);
      $( .ui-widget-overlay ).css( display , block );

      // prevent the default action, e.g., following a link
      return false;
    });


     $( .ui-dialog ).css( top , -5000); //hide the dialog when the page loads, the popup also is hidden via css
});

添加一组 定购单,每行装上上载荷,并装设垫和单壳。

我把我的点击功能替换成像这样的东西。 邮政管理处:

  $( .upload_file ).click(function() {                              
      orig_top_css_wopx = parseInt( orig_top_css.replace( px ,  ) ,10);

      $( .ui-dialog ).css( top , orig_top_css_wopx);
      $( .ui-widget-overlay ).css( display , block );


      var row_id = $(this).attr( id ).replace( attach_ ,  );          
      row_id = parseInt(row_id,10);          

      //alert(row_id);

      if(row_id && row_id > 0) {
        swfu.setPostParams({row_id_key: row_id}); //think this should dynamically set the post param
      } else { 
        alert( Error getting id ); 
      }

      // prevent the default action, e.g., following a link
      return false;
    });

以及我为重新确定习俗而举行的约束性活动:

.bind( dialogbeforeclose , function(event, ui) { 
          closeDialog();
          swfu.setPostParams({});
          return false;
        });

and to get progress working, i added handlers.js and fileprogress.js to my page (from their simpledemo example). then changed the callbacks to their settings:

  custom_settings : {
    progressTarget : "fsUploadProgress",
    cancelButtonId : "btnCancel"
  },
  file_queued_handler : fileQueued,
  file_queue_error_handler : fileQueueError,
  file_dialog_complete_handler : fileDialogComplete,
  upload_start_handler : uploadStart,
  upload_progress_handler : uploadProgress,
  upload_error_handler : uploadError,
  upload_success_handler : uploadSuccess,
  upload_complete_handler : uploadComplete,
  queue_complete_handler : queueComplete    // Queue plugin event

并将之添加到:

<div id="popup">
  Please upload the files you want associated with this row below:
  <span id="dialog_file_upload_btn"></span>

  <input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
    <div class="fieldset flash" id="fsUploadProgress">
            <span class="legend">Upload Queue</span>
  </div>
    <div id="divStatus">0 Files Uploaded</div>
</div>




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签