how to set LoadContentFrom kendo window in run time

前端 未结 3 1588
予麋鹿
予麋鹿 2020-12-20 09:26

i\'m starter in kendo ui, i want use kendoUi window but i have some problem for use i write this code for create window

@(Html.Kendo().Window().Name(\"Detail         


        
3条回答
  •  离开以前
    2020-12-20 09:31

    You need to get hold of the window object, set its url and pass in the query string to the url property. This works for me:

            var window = $("#Details").data("kendoWindow");
            window.refresh({
                url: '/YourController/YourAction/......',
    
            });
            window.open().center();
    

    Additionally, you can pass in some data to the action as well:

            window.refresh({
                url: '/YourController/YourAction/......',
                data: { id: 10, enterpriseId: 88}
    
            });
    

    Or you copuld just have a function to create the window on the fly and set it's content url with some parameter:

        function createKendoWindow(contentUrl) {
            $(document.body).append('
    '); $('#Window').kendoWindow({ title: "Log In", modal: true, resizable: false, width: 400, content: contentUrl, visible: false, minHeight: 350, animation: { open: { effects: "expandVertical", duration: 1000 }, }, close: function () { setTimeout(function () { $('#Window').kendoWindow('destroy'); }, 200); } }).html('').data('kendoWindow').center().open(); }

提交回复
热议问题