More in this section

Forums / General Discussions / Problems with Custom Designer Position

Problems with Custom Designer Position

5 posts, 1 answered
  1. NorseNerd
    NorseNerd avatar
    21 posts
    Registered:
    25 Apr 2011
    21 Sep 2011
    Link to this post
    I'm using a custom designer that takes up a good amount of space.  As a result, it runs off the right of the visible portion of the page (see screenshot) requiring a user to either move the designer or scroll.  I'd like to move it to the center of the screen.

    I've tried overriding existing CSS, but it seems the designer itself is in an iframe and the CSS I need to modify is outside of it.

    Is there a way to either override the template or CSS to center the designer on the screen?
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    22 Sep 2011
    Link to this post
    Hello Norsenerd,

    Did you try this javascript method

    dialogBase.resizeToContent();

    execute it when the dialog loads - e.g. register a load handler with

    this._loadDelegate = Function.createDelegate(this, this._load);
    Sys.Application.add_load(this._loadDelegate);

    and then create a function named _load()

    All the best,
    Lubomir Velkov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. NorseNerd
    NorseNerd avatar
    21 posts
    Registered:
    25 Apr 2011
    22 Sep 2011
    Link to this post
    Hi Lubomir,
      I tried add the load delegate as you suggested, but it did not resolve the issue I was having.  My understanding of the dialogBase.resizeToContent() method is that it re-sizes the content area itself so that all content can be seen.  The issue I'm having is that I want the dialog base to be further over to the left.

    I know the CSS change I need to make, but adding a style block (even when adding an !important on the property) in the design markup file or using jQuery to modify the property does not work.

    Do you have any other suggestions?
  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    27 Sep 2011
    Link to this post
    Hi Norsenerd,

    In this case you could try moving the dialog in the onload event handler. First you need to get a reference to the RadWindow in which you have your dialog. Use this function:

    get_radWindow: function() {
        if (!this._dialog) {
            if (typeof window.radWindow !== "undefined") {
                this._dialog = window.radWindow;
            } else {
                if (window.frameElement != null && typeof window.frameElement.radWindow !== "undefined") {
                    this._dialog = window.frameElement.radWindow;
                }
            }
        }
        return this._dialog;
    }

    Then once you get a reference to the RadWindow in a variable named e.g. oWnd you can retrieve its current bounds with var bounds = oWnd.getWindowBounds(); and you can move the window with oWnd.moveTo(x, y) and resize it with oWnd.set_width(width) and oWnd.set_height(height).


    Kind regards,

    Lubomir Velkov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  5. NorseNerd
    NorseNerd avatar
    21 posts
    Registered:
    25 Apr 2011
    27 Sep 2011
    Link to this post
    Thanks, Lubomir!  That was exactly what I needed.
5 posts, 1 answered