Kendo UI 窗口 + PartialView

3

我在视图中有这段代码

@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窗口中。有人可以帮我吗?谢谢。
2个回答

5

我没有使用正文,而是像你一样使用了.Visible(false),然后在某些事件触发该函数。

function clientLaunchWindow() {

     var window = $("#Name").data("kendoWindow");

     window.refresh({
             url: "/Order/LaunchManualProposalWindow"        
     });      
     window.center();
     window.open();

 };

  public ActionResult LaunchManualProposalWindow()
    {           
        return PartialView("_CreateManualProposal");
    }

不起作用,我把我的代码贴下来了,有什么建议吗?感谢回复。 - Der Schwarze König
我从clientLaunchWindow()示例中删除了.open(),现在一切都很好,非常感谢...现在,我尝试让窗口打开多次。 - Der Schwarze König

0

您可以使用LoadContentFrom并指定Action和Controller。该操作将附加其自己的部分视图。有关详细信息,请参见此处


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接