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

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

2 Answers 57 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rick Bowen
Top achievements
Rank 1
Rick Bowen asked on 14 Mar 2009, 12:41 AM
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 Answers, 1 is accepted

Sort by
0
Roman
Top achievements
Rank 1
answered on 18 Mar 2011, 02:26 PM
Thanks Rick.
It saves me a few hours )
0
Bob
Top achievements
Rank 2
answered on 26 Jun 2012, 07:28 PM
This did save me a few hours!  Thanks!
Tags
Editor
Asked by
Rick Bowen
Top achievements
Rank 1
Answers by
Roman
Top achievements
Rank 1
Bob
Top achievements
Rank 2
Share this question
or