Load on demand

7 posts, 0 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 15 Jun 2009 Link to this post

    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
  2. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 15 Jun 2009 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 15 Jun 2009 Link to this post

    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.
  5. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 16 Jun 2009 Link to this post

    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
  6. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 16 Jun 2009 Link to this post

    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.
  7. Jeremy Wadsworth
    Jeremy Wadsworth avatar
    41 posts
    Member since:
    Mar 2006

    Posted 17 Jun 2009 Link to this post

    This worked for me. Is this a bug that's going to be fixed in the next hotfix?

    Thanks,

    Jeremy
  8. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 18 Jun 2009 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017