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

Client side Window creation not opening as IFRAME

2 Answers 149 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Philip Fourie
Top achievements
Rank 1
Philip Fourie asked on 15 Mar 2011, 02:39 PM
Why is the following code not showing the the conentUrl in an IFrame?
It works if I create the Window on the server side.  Doing it this way shows the popup Window but with a blank screen.

        $.telerik.window.create({
            title: "Selection",
            contentUrl: 'http://www.google.com',
            modal: true,
            resizable: false,
            draggable: true,
            height: 430,
            width: 650,
            visible: false,
            onClose: function () { }
        }).data('tWindow').center().open();

I am using 2010.3.1318

Thank you,
Philip Fourie

2 Answers, 1 is accepted

Sort by
0
Michael Maluck
Top achievements
Rank 2
answered on 18 Mar 2011, 11:54 AM

Hello Philip,

I just had the same question. I did solve it like this:

var htmlText = '<iframe src="' + target + '" frameborder="0" scrolling="no" style="width:100%;height:100%"></iframe>';

var windowElement = $.telerik.window.create({
    ...
    html: htmlText,
    ...
});

HTH
Michael

0
Accepted
Alex Gyoshev
Telerik team
answered on 18 Mar 2011, 02:50 PM
Hello Philip,

Thank you for reporting this issue.

In order to fix it, replace the following line (from the create() method in telerik.window.js):
    windowHtml.cat('">').cat(options.html).cat('</div>')

with the following:
    windowHtml.cat('">')
        .catIf(options.html, !options.contentUrl)
        .catIf('<iframe src="', options.contentUrl,
            '" title="', options.title,
            '" frameborder="0" style="border:0;width:100%;height:100%;">This page requires frames in order to show content</iframe>',
            (/^([a-z]+:)?\/\//i).test(options.contentUrl))
        .cat('</div>')
    .catIf('</div>', !element);


The fix is applied to future builds of the components. Your Telerik points have been updated for the report.

All the best,
Alex Gyoshev
the Telerik team
Tags
Window
Asked by
Philip Fourie
Top achievements
Rank 1
Answers by
Michael Maluck
Top achievements
Rank 2
Alex Gyoshev
Telerik team
Share this question
or