Well like everyone, I'm trying to get my window to open in the center the first time it's loaded.
Initially, I was completely confused as to why the window wasn't opening int he center since I had copied the code exactly.
So, what I realized is happening is that the window loads in the center while it's waiting for the content to load via ajax. Once it loads via ajax, it doesn't move the window to the center, it expands from the top left corner to fit the content of the page that it's loading.
Now what we've done( and the reason we aren't using a fixed height/width) is that we have have one function we add to the click so that we can load all kinds of different content in there and we don't have to worry about the window looking lost in a big open div or having scrolling content.
So, my question, is there any way to get the window to load AFTER the content loads. Or is there some other way tot get it to center itself again after the content loads? This isn't a huge deal, but it's something we'd definitely like to fix.
I've attached some screen shots for you to see what is happening.
Thanks in advance for any help.
Initially, I was completely confused as to why the window wasn't opening int he center since I had copied the code exactly.
function
ShowKendoWindow(link) {
var
title = link.getAttribute(
"WindowCaption"
);
var
url = link.getAttribute(
"WindowURL"
);
var
win = $(
".modal-window"
);
if
(!win.data(
"kendoWindow"
)) {
// window not yet initialized
win.kendoWindow({
animation: {
open: {
effects: { fadeIn: {} },
duration: 200,
show:
true
},
close: {
effects: { fadeOut: {} },
duration: 200,
hide:
true
}
},
content: url,
title: title,
draggable:
true
,
modal:
true
,
resizable:
false
,
}).data(
"kendoWindow"
).center().open();
}
else
{
// reopening window
win.data(
"kendoWindow"
)
.refresh(url)
// request the URL via AJAX
.title(title)
.center().open()
// open the window;
}
event.preventDefault();
}
So, what I realized is happening is that the window loads in the center while it's waiting for the content to load via ajax. Once it loads via ajax, it doesn't move the window to the center, it expands from the top left corner to fit the content of the page that it's loading.
Now what we've done( and the reason we aren't using a fixed height/width) is that we have have one function we add to the click so that we can load all kinds of different content in there and we don't have to worry about the window looking lost in a big open div or having scrolling content.
So, my question, is there any way to get the window to load AFTER the content loads. Or is there some other way tot get it to center itself again after the content loads? This isn't a huge deal, but it's something we'd definitely like to fix.
I've attached some screen shots for you to see what is happening.
Thanks in advance for any help.