【问题标题】:Kendo UI Window + PartialViewKendo UI 窗口 + PartialView
【发布时间】:2014-04-22 00:17:09
【问题描述】:

我的视图中有这段代码

@model IEnumerable<mvcAmerica.Models.Art> 
@(Html.Kendo().Window()
              .Name("window")
              .Title("Agregar Detalle")
              .Draggable()
              .Visible(false)
              .Actions(actions => actions.Close())
              .Events(ev => ev.Close("onClose"))
              .Width(600)
              .Height(600)
              .Content(() =>
                  {
                      @Html.RenderPartial("_ArtViewCreate");
                  })


)
<span id="undo" class="k-button">Click here to open the window.</span>

<script>
    function onClose() {
        $("#undo").show();
    }

    $(document).ready(function() {
        $("#undo").bind("click", function() {
                $("#window").data("kendoWindow").open();
                $("#undo").hide();
            });
    });
</script>

但结果出乎意料,部分视图呈现在我的主页中,而不是在 Kendo UI 窗口中

有人帮帮我吗?

谢谢

【问题讨论】:

    标签: asp.net-mvc-4 kendo-ui


    【解决方案1】:

    我没有使用内容,而是这样做了。 .Visible(false) 就像你一样,然后在某些事件上触发这个函数。

    function clientLaunchWindow() {
    
         var window = $("#Name").data("kendoWindow");
    
         window.refresh({
                 url: "/Order/LaunchManualProposalWindow"        
         });      
         window.center();
         window.open();
    
     };
    
      public ActionResult LaunchManualProposalWindow()
        {           
            return PartialView("_CreateManualProposal");
        }
    

    【讨论】:

    • 不行,我把我的代码贴下来了,有什么建议吗?感谢回复
    • 我从 clientLaunchWindow() 示例中删除 de .open() 并且工作正常,非常感谢....现在,我尝试打开几次窗口
    【解决方案2】:

    您可以使用 LoadContentFrom 并指定 Action 和 Controller。该操作将附加其自己的部分视图。详情请见here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多