从kendo拆分器窗格MVC中的视图刷新整个页面

时间:2014-05-09 06:39:32

标签: javascript jquery asp.net-mvc kendo-ui

我正在尝试从kendo拆分器窗格中加载的视图中刷新整个页面

为了更好的解释,

布局页面中的拆分器

 @(Html.Kendo().Splitter()
  .Name("Splitter")
  .Orientation(SplitterOrientation.Horizontal)
  .HtmlAttributes(new { id="Splitter", style = "height:100%;border:none;" })
  .Events(e => e.Expand("SplitterExpand"))
  .Panes(HorizontalPanes =>
  {
      HorizontalPanes.Add()
          .HtmlAttributes(new { id = "left-pane", style = "height:100%; overflow:visible;background-image:url('" + @Url.Content("~/Content/images/GradientBg.jpg") + "');background-repeat:no-repeat;background-size: 100%;" })
          .Scrollable(false)
          .Collapsible(true)
          .Resizable(false)
          .Size("23%")
          .Content(@<div id="left">
              <img style="float:none"class="logo" src="@Url.Content("~/Content/logo.png")" alt="Logo" />
              <div id="navigation" style=" height:75%;width:95%;overflow-y:scroll">
                  <br />
                  <br />
                  @RenderBody()
              </div>                  <div style="position:relative; top:0%" id="logo">
                  <a href="http://www.olgu.com.tr/" target="_newtab">
                      <img id="image" src="@Url.Content("~/Content/images/Icons/OlguLogo.png")" alt="Logo" style="width:90%;height:5%" /></a>
              </div>
          </div>);
      HorizontalPanes.Add()
          .HtmlAttributes(new { id = "right-pane", style = "height:100%" })
          .Collapsible(false)
          .Scrollable(false)
          .Resizable(false)
          .Size("75%")
          .Content(@<div id="right" class="right">
          </div>);
  })
)

用于加载右侧窗格的布局脚本

    var iframe = document.getElementById("right");
$("#right").html('<object id="displayObj" data="@Url.Content("~/Home/RightIndex")">');

菜单选定项目功能

function select(e)
{
    var span = e.item.getElementsByTagName('span')[0];
    var selectedItem = span.textContent || span.innerText;

    $.ajax({
        url: "@Url.Content("~/Home/MenuLayout")",
        data: { text: selectedItem },
        datatype: "json",
        type: "POST",

        success: function (response, status, xhr)
        {
            $("#right").html('<object id="displayObj" data="'+response+'">');
        },

    error: function (XMLHttpRequest, textStatus, errorThrown)
    {
    }
});
}

菜单布局功能

        [HttpPost]
    public JsonResult MenuLayout(string text)
    {
        var data = Helper.MenuData().Where(m => m.Caption == text).FirstOrDefault();
        return Json(Url.Content(data.ViewName));
    }

例如RightIndex有一个刷新按钮。单击它时,必须刷新整个页面。但是当我尝试刷新时,只有右窗格刷新,我该如何刷新左窗格呢?

0 个答案:

没有答案