Prevent Initial Content Load Until Window Is Opened

6 posts, 0 answers
  1. Bobby
    Bobby avatar
    24 posts
    Member since:
    Nov 2013

    Posted 29 Apr 2014 Link to this post

    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)?
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 01 May 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Bobby
    Bobby avatar
    24 posts
    Member since:
    Nov 2013

    Posted 01 May 2014 in reply to Alex Gyoshev Link to this post

    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.
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 01 May 2014 Link to this post

    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!
     
  6. Bobby
    Bobby avatar
    24 posts
    Member since:
    Nov 2013

    Posted 05 May 2014 in reply to Alex Gyoshev Link to this post

    Pity it's not an automatic function of the Visible == false setting rather than me having to explicitly handle it myself =/
  7. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 06 May 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready