动态将按钮添加到对话框 [英] Add a button to a dialog box dynamically
本文介绍了动态将按钮添加到对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以在jquery ui中动态地向对话框中添加按钮.
Is there any way to add a button to a dialog box in jquery ui dynamically.
我尝试使用:$(this).add("button");
I tried using: $(this).add("button");
推荐答案
有时您也想稍后添加按钮.
Sometimes you want to add the buttons later too.
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
这篇关于动态将按钮添加到对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文