我正在尝试开发一个应用程序,用户可以在单击按钮的弹出窗口中选择日期并查看其事务历史记录,然后将调用ajax并返回然后返回pop内部。 参考:http://romb.github.io/jquery-dialogextend/example.html
<div><button type="button" id="button">Button</button></div>
<script>
$(function () {
var remoteUrl = 'send.php';
var largeParams = {
param1: $("#date").val()
};
$("#button").click(function () {
$("#form").dialog({
"title": "Dialog title",
"width": 640,
"height": 480,
"modal": true,
"resizable": true,
"draggable": true,
"dialogClass": "ui-dialog-red",
message: function (dialogRef) {
var $message = $('<div>Loading...</div>');
$.ajax({
url: remoteUrl,
type: 'POST',
data: largeParams,
context: {
Dialongbox: dialogRef
},
success: function (content) {
this.Dialongbox.setMessage(content);
}
});
return $message;
},
"buttons": {"OK": function () {
$(this).dialog("close");
}}
}).dialogExtend({
"closable": true,
"maximizable": true,
"minimizable": true,
"collapsable": true,
"dblclick": "collapse",
"minimizeLocation": "left",
"icons": {
"close": "ui-icon-close",
"maximize": "ui-icon-arrow-4-diag",
"minimize": "ui-icon-arrowstop-1-s",
"collapse": "ui-icon-triangle-1-s",
"restore": "ui-icon-carat-2-n-s"
}
});
});
});
</script>