var dlg = $("#dialog").dialog({
autoOpen: false,
modal: true,
buttons: {
'Update': function() {
alert(clientCode);
},
Cancel: function() {
$(this).dialog('close');
}
}
});
$(".edit").click(function() {
myval = $(this).parent().children('td:nth-child(1)').text();
dlg.dialog('open');
return false;
});
Run Code Online (Sandbox Code Playgroud)
如何使用"myval"并将其作为对话框的标题?在尝试做dlg.dialog('open', myval)运气时,我已经尝试将其作为参数传递.我也尝试将它作为参数传递,但也没有运气.但是,我可能以错误的方式做事.
$("#your-dialog-id").dialog({
open: function() {
$(this).dialog("option", "title", "My new title");
}
});
Run Code Online (Sandbox Code Playgroud)
在点击事件中创建对话框并使用它来设置标题:
像这样的东西:
$(".edit").click(function() {
myval = $(this).parent().children('td:nth-child(1)').text();
var dlg = $("#dialog").dialog({
autoOpen: false,
title: myval,
modal: true,
buttons: {
'Update': function() {
alert(clientCode);
},
Cancel: function() {
$(this).dialog('close');
}
}
});
dlg.dialog('open');
return false;
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12015 次 |
| 最近记录: |