簡體   English   中英

jQuery對話框-無法禁用打開按鈕

[英]jquery dialog - cannot disable button on open

我想禁用jquery對話框顯示中的某些按鈕(帶有一些其他條件),但我無法執行此操作。 我嘗試了許多不同的方法,但沒有一個起作用。 我沒主意。

附帶的示例代碼(在coffeescript中):

$('#messages').dialog({
  height: 500,
  width: 800,
  resizable: false,
  modal: true,
  show: 'fade', 
  hide: 'clip',
  buttons: [
      {
      id: "msg-close",
      text: "Close",
      click: ->
        $('#msg-close').prop('disabled', true) //this one works
      }
    ],
  open: ->
    $('#msg-close').prop('disabled', true) //this one doesnt work
});

$('#msg-close').prop('disabled', true) //this one doesnt work

打開期望這樣的功能

open: function () {
    $('#msg-close').prop('disabled', true);
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM