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

Prevent Initial Content Load Until Window Is Opened

5 Answers 634 Views
Window
This is a migrated thread and some comments may be shown as answers.
Bobby
Top achievements
Rank 1
Bobby asked on 29 Apr 2014, 09:37 PM
I am rendering a Kendo Window in my view like the following:
@(Html.Kendo().Window()
    .Name("FeedbackWindow")
    .Title(Resources.Title_Feedback)
    .LoadContentFrom("Index", "Feedback")
    .Actions(action => action.Maximize().Close())
    .Modal(true)
    .Iframe(true)
    .Visible(false)
    .AutoFocus(true)
    .Events(events => events.Refresh("FeedbackWindow_Refresh"))
)

While the window starts off hidden (Visible == false) upon view render, it still loads the content on view render.  While this is likely due to using an iframe (so that the window can internally navigate between the different Feedback steps), is there any way to prevent the initial content load until the first time the window is opened (similar to how the ajax window works)?

5 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 01 May 2014, 11:11 AM
Hello Bobby,

In order to achieve this, do not set the LoadContentFrom field initially, and call the client-side refresh method when you open the window:

    var dialog = $("#FeedbackWindow").data("kendoWindow")
    dialog.refresh('@Url.Action("Index", "Feedback")')
    dialog.open();

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bobby
Top achievements
Rank 1
answered on 01 May 2014, 02:15 PM
Hi Alex,

If I remove the LoadContentFrom field and do the dalog.refresh("url"); dialog.open(); work-around that you propose, do I need to preform the special refresh call every time I open the window or just the first time?

Thanks.
0
Alex Gyoshev
Telerik team
answered on 01 May 2014, 03:32 PM
Hello Bobby,

It is necessary to do it only the first time. However, you can do it each time and refresh the content -- whichever seems more appropriate for the application.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bobby
Top achievements
Rank 1
answered on 05 May 2014, 03:30 PM
Pity it's not an automatic function of the Visible == false setting rather than me having to explicitly handle it myself =/
0
Alex Gyoshev
Telerik team
answered on 06 May 2014, 07:45 AM
We will consider changing this behavior for future versions. Thank you for the feedback.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Window
Asked by
Bobby
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Bobby
Top achievements
Rank 1
Share this question
or