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

Built-in content filter - global setting

2 Answers 127 Views
Editor
This is a migrated thread and some comments may be shown as answers.
fudoki22
Top achievements
Rank 1
fudoki22 asked on 03 Mar 2014, 05:21 PM
I would like to disable the RadEditor built-in content filter "ConvertTags" globally rather than in code or markup.
Is this possible? (In the ConfigFile.xml perhaps?).

thanks in advance

2 Answers, 1 is accepted

Sort by
0
Accepted
Ianko
Telerik team
answered on 06 Mar 2014, 07:22 AM
Hello Michael,

Unfortunately the config files does not provide possibility to control the built-in filters of all RadEditor controls. I recommend using the ASP.NET theme and skins feature to globally configure the desired controls.

Another possibility would be implementing a custom Client-side method, attached to the Page_Load event, the logic of which is to find all editors on the page and disable the desired filter. You can examine the following customization as example:
<telerik:RadEditor runat="server" ID="RadEditor1" OnClientLoad="OnClientLoad">
</telerik:RadEditor>
 
<script>   
    Sys.Application.add_load(function () {
        var radControls = $telerik.radControls;
        var editors = [];
        for (var i = 0; i < radControls.length; i++) {
            var control = radControls[i];
            if (control instanceof Telerik.Web.UI.RadEditor) {
                editors.push(control);
            }
        }
        debugger;
        disableFilter(editors, "ConvertTagsFilter");
    })
 
    function disableFilter(editors, filterName) {
        for (var i = 0; i < editors.length; i++) {
            var editor = editors[i];
            var filtersManager = editor.get_filtersManager();
            filtersManager.getFilterByName(filterName).set_enabled(false);
        }
    }
</script>


Regards,
Ianko
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

0
fudoki22
Top achievements
Rank 1
answered on 13 Mar 2014, 05:18 PM
Hi Ianko,

Thanks for the response - adding the custom client side method seems the simplest option for me and worked well.

Regards
--Michael
Tags
Editor
Asked by
fudoki22
Top achievements
Rank 1
Answers by
Ianko
Telerik team
fudoki22
Top achievements
Rank 1
Share this question
or