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

[Solved] Content Area resizes incorrectly

2 Answers 112 Views
Editor
This is a migrated thread and some comments may be shown as answers.
dlamprey
Top achievements
Rank 2
dlamprey asked on 22 Jun 2009, 08:38 PM
I have a page with several dynamically added RadEditors inside an ajax panel, which is inside a RadSplitter. When ever an Ajax request is complete, I resize the splitter so that the panes are equal height.

function resizeDashboardSplitter() { 
    var contentHeight = $('#cms-content-pane').height(); 
    var treeHeight = $('#cms-site-explorer').height(); 
    var newHeight; 
    newHeight = contentHeight > treeHeight ? contentHeight : treeHeight; 
    dashboardSplitter.set_height(newHeight + 15); 
function dashboardSplitterLoaded(splitter, args) { 
    dashboardSplitter = splitter; 
    var prm = Sys.WebForms.PageRequestManager.getInstance(); 
    prm.add_endRequest(resizeDashboardSplitter); 
    resizeDashboardSplitter(); 

The RadEditor loads before the resize, causing the content area to sometimes be squished if the page gets taller. (this is in firefox 3, ie8 seems to work fine.)

Screenshot: squished

If i call the RadEditor method _resizeContentArea from the console of Firebug, it seems to fix the issue. So I added the following javascript:
var radEditors = new Array(); 
function resizeRadEditors() { 
    for (i = 0; i < radEditors.length; i++) { 
        radEditors[i]._updateEditorSize(); 
        radEditors[i]._resizeContentArea(); 
 
    } 
function onEditorLoaded(editor, args) { 
   addEditorStylesheet(editor, args); // not relevant 
   editor.add_modeChange(addEditorStylesheet); // not relevant 
   radEditors.push(editor); 

However, this just made the RadEditor jump to 750px tall, even though it was set at 300px. Any suggestions on how I can fix it?

Thanks!


2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 24 Jun 2009, 03:06 PM
Hi,

The taken approach is not recommended because you are using private methods. It will be best if you send us a sample working project that demonstrates the problem. We will examine it and once reproduce the issue we will do our best to provide a solution.

Currently, you can try the following code:

radEditors[i]._updateEditorSize(radEditors[i].get_element().style.height);

Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
dlamprey
Top achievements
Rank 2
answered on 26 Jun 2009, 11:14 AM
We were able to reproduce the issue without using a RadSplitter at all.  When a RadEditor is added to the page dynamically via an ajax call, the size is not set correctly.  Here is the solution:

"I upgraded the project to use the latest Q2 2009 beta build of RadControls for ASP.NET AJAX and I verified that the problem is fixed. We are targeting a release date for Q2 2009 for the first week of July and my recommendation is to wait for the official release and migrate to it."
Tags
Editor
Asked by
dlamprey
Top achievements
Rank 2
Answers by
Rumen
Telerik team
dlamprey
Top achievements
Rank 2
Share this question
or