0
我想知道是否有任何方法来显示基于在函数中传递的参数的打印按钮。这里是我的代码创建对话框:在JQuery中显示/隐藏打印按钮?
alertInfo: function (message, title, height, width, print) {
$("<div></div>").dialog({
buttons: {
"Ok": function() {
$(this).dialog("close");
},
//show/hide button if argument 'print' equals to 'Yes'
"Print": function() {
$(this).dialog().printArea();
},
},
close: function (event, ui) { $(this).remove(); },
resizable: false,
title: title,
modal: true,
width: height,
height: width,
overflow:'auto',
position: {
my: "center",
at: "center",
of: window
}
}).html(message);
}
这是我传递的参数在alerInfo()
函数的代码:
$.alertInfo(infoTable,'User Info',800,600,'Yes');
我还没有得到这个工作,如果我试图如果发生“打印”按钮错误时出现语句。如果有人能帮助请让我知道。
什么是“OK”和“打印”在您的代码 – Geeky
@Geeky确定和打印是按钮。 –