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

[Solved] MVC Popup Window look and Feel

5 Answers 235 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.
Tony
Top achievements
Rank 1
Tony asked on 27 Apr 2011, 07:00 PM
Hi,

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

Sort by
0
nachid
Top achievements
Rank 1
answered on 27 Apr 2011, 11:19 PM
Try this and see if it can help
0
Tony
Top achievements
Rank 1
answered on 28 Apr 2011, 04:21 PM
Thanks for the link. That was not what I was looking for.

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?

0
nachid
Top achievements
Rank 1
answered on 28 Apr 2011, 06:48 PM
To change the title
$('#Window').data('tWindow').title( 'Your new title')


To change width and height to  new values (h and w )
$('#Window').css({ 'height': h, 'width': w });
0
Tony
Top achievements
Rank 1
answered on 28 Apr 2011, 07:53 PM
This is getting me closer. I can see the widow is resized as I want. However, the original size of the window is still overlaying the new window. I can see the top and left side of the smaller window but the bottom and right sides are blown out by the original window size.
0
Pavel
Top achievements
Rank 1
answered on 19 May 2011, 09:43 AM
I use this combination:

$('#Window').css({ 'height': 400, 'width': 550 });
$('div.t-window-content').css({ 'height': 400, 'width': 550 });
Tags
Window
Asked by
Tony
Top achievements
Rank 1
Answers by
nachid
Top achievements
Rank 1
Tony
Top achievements
Rank 1
Pavel
Top achievements
Rank 1
Share this question
or