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

Window size as a percentage?

3 Answers 234 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.
Michael Dunbar
Top achievements
Rank 2
Michael Dunbar asked on 11 Nov 2010, 03:22 PM
Is it possible to set the width and height of the window as a percentage value?

It seems to take an int that is only translated as a fixed pixel width from what I can see. Is there a means of overriding that to translate the unit as a percent?

If not, can you add it to a wishlist :)

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 12 Nov 2010, 09:49 AM
Hi Michael Dunbar,

 Setting the width or height in percentage is a bit tricky. The window detaches from its parent element once loaded and attaches to the BODY. I think some users will expect the width to be relative to the parent element instead of the BODY. If you set the width of the window to say 50% what do you expect to happen? Should the window be half the viewport wide or half the parent element?

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael Dunbar
Top achievements
Rank 2
answered on 12 Nov 2010, 09:56 AM
Hmmm yes, I see the issue.

If using modal then the answer is easier as you would expect it to be relative to the body/view port, as the window is visually detatched from the other page elements. If not, then perhaps there is a use case to have the window size relative to a parent that is not the body/view port.
0
Accepted
Atanas Korchev
Telerik team
answered on 12 Nov 2010, 01:27 PM
Hello Michael Dunbar,

 Currently you can set the size of the window using JavaScript (preferably in its OnLoad event):

function onLoad() {
    $(this).width('50%').height('100%');
}
If you use percentage there the window will endup being relative to the viewport.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Michael Dunbar
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Michael Dunbar
Top achievements
Rank 2
Share this question
or