- 注册时间
- 2014-8-25
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 858
- 精华
- 0
- 帖子
- 4
|
dforce 发表于 2014-8-26 10:17
请提供完整页面
从你贴的代码看不出leftMenu是MiniUI控件
1: Layout.cshtm
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="../../App_Themes/InFrame/Content.css" rel="stylesheet" type="text/css" />
<link href="../../App_Themes/InFrame/InFrame.css" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="../../Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.layout-latest.js")" type="text/javascript"> </script>
<script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-i18n.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/script.js")" type="text/javascript"> </script>
<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" media="screen" />
<link href="@Url.Content("~/Content/layout-default-latest.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/bootstrap.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive-custom-for-bootstrap.js")" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../../Content/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="../../Content/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="../../Content/bootstrap-mvc-validation.css" />
<link rel="stylesheet" type="text/css" href="../../Content/bootstrap-sortable.css" />
<script src="../../Scripts/miniscripts/boot.js?123" type="text/javascript"></script>
<script src="../../Scripts/Common/SetMiniuiTreeSize.js?1243567" type="text/javascript"></script>
</head>
<body>
@RenderBody()
</body>
</html>
2: Index
@{Layout = "~/Views/Shared/_LayoutKilian.cshtml";}
<div id="errormsg">
</div>
<div id="LeftMenu" class="ui-layout-west" style="overflow: hidden">
@Html.Action("Left")
</div>
<div class="ui-layout-center ui-widget-content" id="Main" name ="Main">
@Html.Action("rojectTypeIndex")
</div>
<script>
function ReloadLeftTree() {
$("#LeftMenu").load("/ProjectTypeManage/Left");
}
</script>
3eft
@model List<Kilian.Model.DTO.ProjectTypeDto>
@{Layout = null;}
<ul id="demoTree" class="mini-tree" showTreeIcon="true" style="width:100%;height:100%;"
enableHotTrack="true" >
<li>
<span id="titlespan"><i class="icon-folder-open"></i>@Ajax.ActionLink("项目类型", "rojectTypeIndex", new AjaxOptions { UpdateTargetId = "Main" })</span>
<ul>
@foreach (var m in Model)
{
<li>
<span expanded="false">@Ajax.ActionLink(m.Name, "StageIndex", new { @pid = m.Id }, new AjaxOptions { UpdateTargetId = "Main" }) </span>
<ul>
@foreach (var s in m.StageDtos)
{
<li>@Ajax.ActionLink(m.Name, "WorkIndex", new { @pid = m.Id }, new AjaxOptions { UpdateTargetId = "Main" })</li>
}
</ul>
</li>
}
</ul>
</li>
</ul>
4: AJAX提交页面后 更新 Main 区域,同时在 OnSuccess 中调用 "ReloadLeftTree()" 来刷新左侧菜单树。
@model Kilian.Model.DTO.ProjectTypeDto
@*,OnSuccess = "ReloadLeftTree()",*@
@using (Ajax.BeginForm(new AjaxOptions { UpdateTargetId = "Main", HttpMethod = "ost",OnSuccess = "ReloadLeftTree()", }))
{
@Html.ValidationSummary(true)
<fieldset class="form-horizontal">
@Html.HiddenFor(model => model.Id)
<div class="control-group">
<label class="control-label" for="Code">编号</label>
<div class="controls">
@Html.EditorFor(model => model.Code, new { @class = "input-xlarge" })
@Html.ValidationMessageFor(model => model.Code, null, new { @class = "help-inline" })
</div>
</div> |
|