【发布时间】:2012-07-03 02:15:15
【问题描述】:
我希望能够在运行时更改模式的标题和按钮。 目前我有这个 我有批准或拒绝的操作
var recButton = actions =='approval' ? 'Approve' : 'Deny';
$("#dialog").dialog(
{
modal : true,
buttons : {
'update all' : function() {
// window.location.reload();
// $( this ).dialog( "close" );
//do something here
},
Cancel : function() {
$(this).dialog("close");
}
}
}); //dialog
});
我也尝试为按钮这样做
$("#dialog").dialog(
{
modal : true,
buttons : {
recButton : function() { ...
但在模态中它翻译得不好,只是说 recButton 而不是变量值。我也需要更改标题。
更新:通过简单的标题获得标题:
【问题讨论】:
-
你总是这样缩进代码吗?
-
是的..很糟糕吗?我有很多代码
标签: javascript jquery jquery-ui modal-dialog jquery-dialog