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

Dynamically Grow Window

1 Answer 576 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mono
Top achievements
Rank 1
Mono asked on 06 Dec 2011, 02:55 PM
Hello,

I have a basic Window. This Window has a basic Tab Strip. Some of the content in each of the tabs will dynamically appear. When the content appears, the size of the tab dynamically grows, which is what I want. However, the Window stays the same size. Ideally, I would like for the Window height to grow as well. Is there a way to do this? I've included my code below to demonstrate what I'm talking about. Also, is there any support for a maxHeight-esque property?

<input type="button" id="testButton" value="Test" onclick="return testButton_Click();" />
<div id="testDialog">
    <div id="testTabs">
        <ul>
            <li class="k-state-active">Tab 1</li>
            <li>Tab 2</li>
        </ul>
 
        <div>
            <div id="errBanner" style="padding-bottom:8px;">Testing a longer error message. This thing will wrap. There is a chance this will wrap. It should.</div>
            <div>Name</div>
            <input id="nameTextBox" />
            <div>Please enter your name.</div>
        </div>
 
        <div>
            Tab 2 Content
        </div>
    </div>
 
    <input type="button" id="validateButton" value="Validate" onclick="validateButton_Click();" />
</div>
 
<script type="text/javascript">
    $().ready(function () {
        $("#testDialog").kendoWindow({
            visible: false,
            title: "Test",
            minHeight: 150,
            minWidth: 400,
            modal: true,
            open: function () {
                $("#errBanner").hide();
            }
        }).data("kendoWindow");
 
        $("#testTabs").kendoTabStrip({
            animation: { open: { effects: ""} }
        });
    });
 
    function testButton_Click() {
        var dialog = $("#testDialog").data("kendoWindow");
        dialog.center();
        dialog.open();
    }
 
    function validateButton_Click() {
        $("#errBanner").show();
    }
</script>

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 06 Dec 2011, 03:34 PM
Hello Mono,

If you don't specify explicit height to the Window, it will resize automatically, according to its content as long as the user does not resize the widget manually with the mouse. From this moment on the Window will maintain the user-defined size. If you want to change this behavior, you will have to remove the height style from the <div class="k-widget k-window"> element with Javascript at the moment the content inside changes.

Best wishes,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Window
Asked by
Mono
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or