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

Load content on click into window

5 Answers 2603 Views
Window
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 31 Jul 2012, 02:49 AM
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.

5 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 31 Jul 2012, 06:00 AM
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!
0
Andrew
Top achievements
Rank 1
answered on 31 Jul 2012, 07:05 AM
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
0
Accepted
Atanas Korchev
Telerik team
answered on 31 Jul 2012, 07:56 AM
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!
0
Andrew
Top achievements
Rank 1
answered on 01 Aug 2012, 03:07 AM
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.
0
Ruonan
Top achievements
Rank 1
answered on 17 May 2014, 06:18 PM
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.
Tags
Window
Asked by
Andrew
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Andrew
Top achievements
Rank 1
Atanas Korchev
Telerik team
Ruonan
Top achievements
Rank 1
Share this question
or