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

Load on demand

6 Answers 66 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Fit2Page asked on 15 Jun 2009, 08:53 AM
Hello Telerik,

I am currently working on integration of the Editor in our CMS.
Imagine the following configuration:

7 AJAX tabpanels (languages) with 4 Editor instances each. For speed sake I want to load the Editors OnClientClick.
What is the way to go to load the Editors on demand?

Are there any code snippets / examples for this?

Thanks in advance for your answer,

Marc

6 Answers, 1 is accepted

Sort by
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 15 Jun 2009, 10:34 AM
OK now i have implemented the Tabstrip Load On Demand demo with three Tabs which contain two Editors each. Seems to work OK exept that the Editors widths are not properly set when the Tabs are clicked.

I discovered this earlier with an AJAX tabpanel also in FF and IE. Is this a known bug?

BR,
Marc
0
Rumen
Telerik team
answered on 15 Jun 2009, 03:57 PM
Hi Marc,

Please, try the following fix for the problem:

<script type="text/javascript">  
function OnClientInit(editor)  
{        
    var width = editor.get_element().style.width;  
    editor.add_firstShow(function()  
    {                 
        editor.get_element().style.width = width;      
    });  
}  
</script>   
 
 <telerik:RadEditor ID="RadEditor1"  
         OnClientInit="OnClientInit"  
         runat="server">   
 </telerik:RadEditor> 

All the best,
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
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
answered on 16 Jun 2009, 07:01 AM
Thank you Rumen, this works!

Only  a slight flicker can be seen when starting up the tab where the Editors are in.
Is it possible to hide the Editors before it is scaled to the correct width?

BR,
Marc
0
Rumen
Telerik team
answered on 16 Jun 2009, 07:40 AM
Hi Marc,

I added the editor in a hidden div element and displayed the div in the onClientInit event of RadEditor:

<script type="text/javascript">   
function OnClientInit(editor)   
{         
    var width = editor.get_element().style.width;   
    editor.add_firstShow(function()   
    {                  
        editor.get_element().style.width = width;       
    });   
     
    //show the div when the editor initialized 
    $get("wrapper").style.display = ""
}   
</script>    
<div style="display:none" id="wrapper"
    <telerik:RadEditor ID="RadEditor1"   
         OnClientInit="OnClientInit"   
         runat="server">    
    </telerik:RadEditor>  
</div> 

I hope this helps.

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
Jeremy Wadsworth
Top achievements
Rank 1
answered on 17 Jun 2009, 11:49 PM
This worked for me. Is this a bug that's going to be fixed in the next hotfix?

Thanks,

Jeremy
0
Rumen
Telerik team
answered on 18 Jun 2009, 07:48 AM
Hi Jeremy,

We will do our best to have the problem fixed for the official Q2 2009 release.

Best regards,
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.
Tags
Editor
Asked by
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Fit2Page
Top achievements
Rank 2
Iron
Iron
Iron
Rumen
Telerik team
Jeremy Wadsworth
Top achievements
Rank 1
Share this question
or