Edit this page

get_mode

Returns the editor's mode:

function get_mode()
returned value: 1 integer represents Design mode
returned value: 2 integer represents HTML mode
returned value: 4 integer represents Preview mode

The following example demonstrates how to check the current mode of Telerik RadEditor:

<script type="text/javascript">
    function OnClientLoad(editor, args)
    {     
        editor.add_modeChange(function(sender, args)     
        {        
            var mode = sender.get_mode();                             
            switch (mode)        
            {           
                case 1:            
                    alert( "We are in Design mode");            
                    //do something            
                    break;           
                case 2:            
                    alert( "We are in Html mode");            
                    //do something            
                    break;           
                case 4:            
                    alert( "We are in Preview mode");
                    //do something            
                    break;
            }
        });
    }
</script>
<telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ID="RadEditor1">
</telerik:radeditor>