This is a migrated thread and some comments may be shown as answers.

Loading view in Kendo Custom window

1 Answer 398 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 29 Aug 2013, 12:15 PM
Hi to all,
I am doing crud operation by using Kendo Grid and using default window opening.

I searched a lot for custom window but didn't find the good example.

what i wants is that on Add and Edit  i wants to open my own form in Kendo window
i.e create.cshtml and Edit.cshtml .

I used lot of examples of kendo window but there were lot of problem sometimes
 window not opening sometime form design changing when clicking again and again.

Please guide me what to do
or if possible provide me sample where cutom window can be open on Add and edit
and i can load my forms inside that.

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Jack
Top achievements
Rank 1
answered on 29 Aug 2013, 12:40 PM
Ok  i got it.My window has been opened.
Let me explain here so that it helps another person

Firstly we have to inatialize th window
 
@(Html.Kendo().Window()
                      .Name("window")
                      .Title("Add User")
                      .Content("loading...")
                     .LoadContentFrom("Create","ProductKendo")
                      .Modal(true)
                      .Width(550)          
                      .Height(300)          
                      .Draggable()
                      .Visible(false)
                     )
<button id="btnWindowKendo" value="OpenWindow"></button>
Let me clarify .LoadContentFrom-   i am passing my Controller name along with action name.In the action Create i am simply calling
my View.In another words i am loading view in custom window. 

After that
 <script>
                    $(document).ready(function () {
                        var window = $("#window").data("kendoWindow");

                        $("#btnWindowKendo").click(function (e) {
                            window.center();
                            window.open();
                        });
                       
                    });

</script>
Tags
Window
Asked by
Jack
Top achievements
Rank 1
Answers by
Jack
Top achievements
Rank 1
Share this question
or