本文介绍了将按钮添加到jQuery UI对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法在此jQuery UI对话框中添加按钮.如果可能的话请给我一个例子.谢谢.
I can not add button to this jquery ui dialog.if possible please give me an example .thanks.
<script type="text/javascript">
$(document).ready(function () {
//setup new person dialog
$('#dialog2').dialog({
autoResize: true,
show: "clip",
hide: "clip",
height: 'auto',
width: '1000',
autoOpen: false,
modal: true,
position: 'top',
draggable: false,
title: "انتخاب درخواست",
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
$('#viewfaktor').dialog({
autoResize: true,
show: "clip",
hide: "clip",
height: 'auto',
width: '1000',
autoOpen: false,
modal: true,
position: 'top',
draggable: true,
title: "مشاهده صورت ریز",
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
$('#msgBox').dialog({
autoResize: true,
show: "clip",
hide: "clip",
height: 'auto',
width: 'auto',
autoOpen: false,
modal: true,
position: 'center',
draggable: false,
open: function (type, data) {
$(this).parent().appendTo("form");
}
});
});
function showDialog(id) {
$('#' + id).dialog("open");
}
function closeDialog(id) {
$('#' + id).dialog("destroy");
}
</script>
推荐答案
$('#msgBox').dialog({
autoResize: true,
show: "clip",
hide: "clip",
height: 'auto',
width: 'auto',
autoOpen: false,
modal: true,
position: 'center',
draggable: false,
open: function (type, data) {
$(this).parent().appendTo("form");
},
buttons: { "OK": function() { $(this).dialog("close"); } }
});
这篇关于将按钮添加到jQuery UI对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!