gpt4 book ai didi

jquery - 一个 Jquery 对话框可以打开另一个 Jquery 对话框吗?

转载 作者:行者123 更新时间:2023-12-01 08:18:49 25 4
gpt4 key购买 nike

我想打开一个部分 View 作为 JQuery 对话框,当我单击链接时,可以在已打开的对话框上打开另一个 Jquery 对话框。

我可以这样做吗?如果可以的话,我该如何实现呢?

编辑1:

第一次查看

@model AuctionWebProject.Areas.Admin.Models.CategoryModel  
@{
ViewBag.Title = "Edit Category";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<!DOCTYPE html>
<html>
<head>
<title>EditCategory</title>
</head>
<body>
<script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.16.min.js")" type="text/javascript"></script>
<script type="text/javascript">
function ShowXsdEditor() {
$("#xsdEditor").dialog("open");
}
</script>
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
<fieldset>
<legend>CategoryModel</legend>
@Html.HiddenFor(model => model.Id)
<div class="editor-label">
@Html.LabelFor(model => model.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Date)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Date)
@Html.ValidationMessageFor(model => model.Date)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.Xsd)
</div>
<div class="editor-field">
@Html.TextAreaFor(model => model.Xsd, new { disabled = "disabled" })
@Html.ValidationMessageFor(model => model.Xsd)
<a href="javascript:void(0)" onclick="ShowXsdEditor();">Xsd Editor</a>
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@Html.Partial("XsdEditor", Model)
</body>
</html>

第二个 View

    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript">  </script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div id="xsdEditor" style="display: none;">
<a href="javascript:void(0)" onclick="ShowDialog();">Add new element</a>
<div id="elementList">
</div>
</div>
@Html.Partial("AddXSElement", new AuctionWebProject.Areas.Admin.Models.XSElementModel())
<script type="text/javascript">
$(document).ready(function () {
$("#xsdEditor").dialog({
autoOpen: false, width: 400, height: 330, modal: true, title:'XSD Editor'
});
});

function ShowDialog() {
debugger;
$("#addXSElement").dialog("open");
}
</script>

我使用 JQuery v 1.6.2 和 Jquery Ui 1.8.12

最佳答案

根据the fiddle我已经创建了,它会毫无问题地显示。

关于jquery - 一个 Jquery 对话框可以打开另一个 Jquery 对话框吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8647161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com