I am new to the MVC controls. I have added a hidden modal Telerik window to my view and want to leverage it from the client side. I found your sample "222319_windowieissue" which in general is doing what I want. However, is it possible (in the javascript call) to change the height, width and title of the window to better suit the partial view being returned? If so how?
Thanks.
5 Answers, 1 is accepted
I have a hidden modal window on my view like this:
<!-- Test Window -->
<%
= Html.Telerik().Window()
.Name(
"Window")
.Title(
"My Title")
.Visible(
false)
.Modal(
true)
.Width(500)
.Height(400)
%>
I make a javascript call to load the window like this:
$.post(
"/Controller/Method", { id: "Something" }, function (data) {
$(
"#Window").data("tWindow")
.content(data)
.center()
.open();
});
I will be making several javascript controller methods calls to load different types of information into this window. My problem is that I want to be able to change the window Title, Height and Width to reflect the call being made. As you can see the initial definition is 400 X 500. However, if the javascript call returns information that would fit in a 200 X 300 window I want to be able to change the window size.
Poking around I found a way to change the title of the popup from the client side
$("#Window .t-window-title").html(newTitle);
I am looking for similar syntax to change the height and width. Is that possible from the client side?
$('#Window').data('tWindow').title( 'Your new title')To change width and height to new values (h and w )
$('#Window').css({ 'height': h, 'width': w });$('#Window').css({ 'height': 400, 'width': 550 });$('div.t-window-content').css({ 'height': 400, 'width': 550 });