OnClientLoad, ApplyClass - "Object does not support this property or method"

3 posts, 0 answers
  1. Rick Bowen
    Rick Bowen avatar
    1 posts
    Member since:
    Mar 2007

    Posted 13 Mar 2009 Link to this post

    Hi, spent a bunch of time nogging over this one. Finally figured it out. I traced it all the way back to the Telerik.Web.UI.Editor.RadEditor.js. I'm using Q1 2009 RadControls for ASP.NET Ajax.

    I was getting a "Object does not support this property or method" error when using the following script:

     

     

        <script type="text/javascript">  
            function OnClientLoad(editor, args) {  
                editor.fire("SelectAll");  
                editor.fire("ApplyClass", { value: ".default" });  
            }  
        </script> 
     

    Figured out that it need an object with a get_value() method:

     

        <script type="text/javascript">  
            function OnClientLoad(editor, args) {  
                editor.fire("SelectAll");  
                objCssClass = new Object(); objCssClass.get_value = function() { return ".default"; }  
                editor.fire("ApplyClass", objCssClass);  
            }  
        </script> 
     

    Hope this saves someone a few hours :)

  2. Roman
    Roman avatar
    25 posts
    Member since:
    Sep 2010

    Posted 18 Mar 2011 Link to this post

    Thanks Rick.
    It saves me a few hours )
  3. Bob
    Bob avatar
    6 posts
    Member since:
    Nov 2011

    Posted 26 Jun 2012 Link to this post

    This did save me a few hours!  Thanks!
Back to Top