Load content on click into window

6 posts, 1 answers
  1. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 30 Jul 2012 Link to this post

    I would like to load different content into the window depending on what button the user clicks.

    Right now i have always the same text inside.

    @(Html.Kendo().Window()
            .Name("window")
            .Content(@<text>
                <p>
                    Blah Blah
                </>
            </text>)
            .Width(540)
            .Height(480)
            .Visible(false)
            )
    var kendoWindow = $("#window");
             
            $("#openEmail").click(function (e) {
    ???????
                kendoWindow.data("kendoWindow").open();
            });
            $("#openBox").click(function (e) {
    ???????
                kendoWindow.data("kendoWindow").open();
            });
            $("#openDesk").click(function (e) {
    ??????
                kendoWindow.data("kendoWindow").open();
            });
             
            $("#window").click(function (e) {
                kendoWindow.data("kendoWindow").close();
            });

    I want to be to somehow add the content inside where i put the ?????, but i am not sure how.

    Or maybe some other alternative way of doing this?

    Any help would be appreciated.

  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 31 Jul 2012 Link to this post

    Hello Andrew,

    You can use the content method for static content (available on the page), or the refresh method for dynamic (fetched through AJAX or in an iframe).

    All the best,
    Alex Gyoshev
    the Telerik team
    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. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 31 Jul 2012 Link to this post

    Can you explain how to use the content method?
    The help files are absolutely no help. Excuse the pun.

    I was trying to do something like this:

    $("#openEmail").click(function (e) {
                kendoWindow.data("kendoWindow").Content = ????
                kendoWindow.data("kendoWindow").open();
            });

    But i get a .Contents() method rather then Content
  5. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 31 Jul 2012 Link to this post

    Hi Andrew,

     The linked help topic contains an example which shows how to use the content method. Perhaps you have missed it:

    $("#window").data("kendoWindow").content("Kendo UI for all the things!");

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Andrew
    Andrew avatar
    171 posts
    Member since:
    Jun 2009

    Posted 31 Jul 2012 Link to this post

    I did see the example.
    However within Visual Studio it was giving me an error.
    Turns out it was intelisense that was causing it.
    Changing the word .content to .contents

    So i guess the solution here is simply ignore visual studio and it works just fine.

    Thanks for your help.
  7. Ruonan
    Ruonan avatar
    1 posts
    Member since:
    Mar 2013

    Posted 17 May 2014 Link to this post

    Hey Guys
            I have an issue of this topic as well.
            I am going to open a window when clicking <a href="http://www.google.com"> link</a> and view the web content the <a> pointed to.

    right now, the content does not refreshed.
Back to Top
Kendo UI is VS 2017 Ready