Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Window > MVC Popup Window look and Feel
Telerik MVC Extensions are no longer supported (see this page for reference). In case you have inquiries about Kendo UI Complete for ASP.NET MVC, post them in the pertinent Kendo UI forums.

Not answered MVC Popup Window look and Feel

Feed from this thread
  • Tony avatar

    Posted on Apr 27, 2011 (permalink)

    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.

  • nachid Master avatar

    Posted on Apr 27, 2011 (permalink)

    Try this and see if it can help

  • Tony avatar

    Posted on Apr 28, 2011 (permalink)

    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?

  • nachid Master avatar

    Posted on Apr 28, 2011 (permalink)

    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 });

  • Tony avatar

    Posted on Apr 28, 2011 (permalink)

    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.

  • Pavel avatar

    Posted on May 19, 2011 (permalink)

    I use this combination:

    $('#Window').css({ 'height': 400, 'width': 550 });
    $('div.t-window-content').css({ 'height': 400, 'width': 550 });

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Window > MVC Popup Window look and Feel
Related resources for "MVC Popup Window look and Feel"

ASP.NET MVC Window Features  |  Documentation  |  Demos  |  Telerik TV ]