dialogBase.resizeToContent()

Posted by Community Admin on 04-Aug-2018 16:39

dialogBase.resizeToContent()

All Replies

Posted by Community Admin on 22-Sep-2011 00:00

My control designer is not resizing based on the size of the contents, (including a dynamically updated RadGrid), even when I explicitly add "dialogBase.resizeToContent()" after the script which triggers the elements to change size.  Even the initial size seems off for the empty grid. 

I am curious how "resizeToContent" works.  Do I have to have a specific type of content in the control in order for it to work (such as "block" type elements only at the top level)?

Do I have to use CSS to size the contents ahead of time, perhaps?

Posted by Community Admin on 22-Sep-2011 00:00

Hello Jeff,

Could you send us the source for your designer so we could examine it and see what happens? Do you get any Javascript errors during the loading/showing of your designer in the dialog?

Greetings,
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

Posted by Community Admin on 23-Sep-2011 00:00

I can't send my source, and it would be too complicated to get it running anyway, as it relies on non-public web services.

However, I am interested in general knowlege about this topic, such as how the "resizeToContent" works, what kind of content has to be present, and how it interacts with sizes specified in CSS.  Is there a best practice for creating the content so that "resizeToContent" will work correctly, and the control will be sized correctly initially?  Also, is there any reference material on the subject, or examples you can point me to?

Posted by Community Admin on 26-Sep-2011 00:00

Hi Jeff,

The resizeToContent function is based on RadWindow. Since its contents is inside an IFRAME, the browser is able to calculate the needed amount of space required to display all the elements in the nested IFRAME document, so the function basically resizes the IFRAME wrapper.

You could see the source of this function if you load Telerik.Sitefinity.dll with a tool like Reflector and navigate its resources to Telerik.Sitefinity.Web.Scripts.AjaxDialogBase.js - there is the function

resizeToContent: function (oWnd)
  ...

Best wishes,
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

This thread is closed