Add button to jquery ui dialog

后端 未结 4 1422
北恋
北恋 2020-12-14 19:42

I can not add button to this jquery ui dialog. if possible please give me an example . thanks.



        
4条回答
  •  被撕碎了的回忆
    2020-12-14 20:02

    Sometimes you want to add the buttons dynamically after the dialog is created too. See my answer at the question Add a button to a dialog box dynamically

    var mydialog = ... result of jqueryui .dialog()
    var buttons = mydialog.dialog("option", "buttons"); // getter
    $.extend(buttons, { foo: function () { alert('foo'); } });
    mydialog.dialog("option", "buttons", buttons); // setter
    

提交回复
热议问题