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

[Solved] Modal window cannot be loaded twice in a row

3 Answers 150 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.
Jose
Top achievements
Rank 1
Jose asked on 24 Jun 2011, 09:16 PM

I have the following code to create a modal window:

function openCalculator() {
    var acts = new Array();
    acts[0] = "Refresh";
    acts[1] = "Close";
 
     
    var windowCalculator = $.telerik.window.create({
        title: "Rate Calculator",
        html: '',
        contentUrl: "/RulesEngine/RateCalculator/",
        modal: true,
        resizable: true,
        height: 350,
        width: 800,
        draggable: true,
        actions: acts,
        visible: false,
        onClose: function (e) {
 
             e.preventDefault();
            windowCalculator.destroy();
        }
    })
    .data('tWindow').center().open();
 
}

If the user closes the modal window and tries to re open it, the program throws the following exception:

Unable to get value of the property 'window': object is null or undefined

In addition. The function only loads its content from the contentURL page the first time. it does not refresh the content every time the function is called, which is the behavior that we would expect. Can you help me, please?

3 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 29 Jun 2011, 10:48 AM
Hello Jose,

We could not reproduce this problem neither in Firefox 5, nor in IE9. Please try upgrading to the attached build and see whether the problem persists.

Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jose
Top achievements
Rank 1
answered on 29 Jun 2011, 01:15 PM
Thank you Alex, but I found the problem yesterday. The problem wasn't in my javascript function; it was in the url where I get the content for the window. I was including the jquery scripts in that page; once I took the links out, it worked perfectly.
0
Ankit
Top achievements
Rank 1
answered on 21 Dec 2011, 06:32 PM
Hi Jose,

This is kinda late but still... I had the same problem. I was loading the content of my window dynamically and when I included scripts, I was not able to open it the second time. But I cannot get rid of the scripts as I am using jQuery validation. And since the content which is loaded is from PartialView, I have to include the scripts there. Any suggestions or workarounds?

Thanks
Ankit
Tags
Window
Asked by
Jose
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Jose
Top achievements
Rank 1
Ankit
Top achievements
Rank 1
Share this question
or