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

Loading Progress

1 Answer 119 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.
Adam Salvo
Top achievements
Rank 1
Adam Salvo asked on 28 Dec 2010, 06:17 PM
I'm creating and opening a modal window, but my content sometimes takes awhile to load. This results in an empty window with a white background. I would like to have some sort of animated image displayed that gives an indication to the user that the application is still working. I was wondering if there was something built into the server or client side API that would enable this. If not, is there a work around I could use (set the content to the loading image on the server side, which would be replaced with the desired content after it's loaded).

I was looking at the documentation on the website for some client side events or methods I could use, but the documentation seems to be a bit behind. For example, there is no mention of the content() or center() methods.

Current Server Side Window Declaration:

<%Html.Telerik().Window()
.Name("CreateEditWindow")
.Modal(true)
.Visible(false)
.Height(510)
.Width(785)
.Render(); %>

Current Client Side Code:

function EditLink_OnClick(id) {

var hWin = $('#CreateEditWindow').data('tWindow');

hWin.title("Edit Template");
hWin.content('<iframe src=\'<%=Url.Action("edit", "deviceedittemplate")%>/' + id + '\' frameborder=\'0\' style=\'width: 100%; height: 100% \'></iframe>');
hWin.center().open();

}


Thanks,

Adam

1 Answer, 1 is accepted

Sort by
0
Brian Adle
Top achievements
Rank 1
answered on 03 Feb 2011, 07:47 PM
I ran into this same problem when opening a window from javascript and got around it in the following manner:

var myWindow = $.telerik.window.create({
    title: "window title",
    html: "<div>{LOADING IMAGE}</div>",
    contentUrl: "myController/myView",
    [other options]
});

var window = myWindow.data('tWindow');
window. center();
window.open();

This will display the {LOADING IMAGE} html while it waits for the contentUrl's response.  It's working great.
Tags
Window
Asked by
Adam Salvo
Top achievements
Rank 1
Answers by
Brian Adle
Top achievements
Rank 1
Share this question
or