RadEditorStatistics off by One Character

3 posts, 0 answers
  1. Rodney
    Rodney avatar
    54 posts
    Member since:
    Mar 2015

    Posted 01 May 2017 Link to this post

    I'm using the EditorModule RadEditorStatistics and it always returns one less character than what has actually been entered in the text box. I'm not sure if it's the way I've implemented it or if that is just the way it works. Any help would be appreciated. I'm including the markup and js I use. Any help would be greatly appreciated.

    <telerik:RadEditor ID="redJustification" runat="server" EditModes="Design"
            MaxTextLength="4000" SkinID="DefaultSetOfTools" ContentAreaMode="Div" OnClientInit="CharCountInit"
            Height="225px" Width="98%" Style="background-color: White; overflow: auto; display: block"
            Skin="Default" TabIndex="51">
            <Tools>
                <telerik:EditorToolGroup>
                    <telerik:EditorSeparator />
                    <telerik:EditorTool Name="Cut" />
                    <telerik:EditorTool Name="Copy" />
                    <telerik:EditorTool Name="Paste" />
                    <telerik:EditorSeparator />
                    <telerik:EditorTool Name="SelectAll" />
                    <telerik:EditorTool Name="FindAndReplace" />
                    <telerik:EditorSeparator />
                    <telerik:EditorTool Name="AjaxSpellCheck" />
                    <telerik:EditorSeparator />
                </telerik:EditorToolGroup>
            </Tools>
            <Modules>
                <telerik:EditorModule Name="RadEditorStatistics" />
            </Modules>
        </telerik:RadEditor>
    function CharCountInit() {
        var originalRender = Telerik.Web.UI.Editor.Modules.RadEditorStatistics.prototype.render;
     
        Telerik.Web.UI.Editor.Modules.RadEditorStatistics.prototype.render = function () {
            originalRender.apply(this);
     
            this.get_editor().remove_selectionChange(this._onDoCountDelegate);
            this.get_editor().attachEventHandler("onkeydown", this._onDoCountDelegate);
        };
    }

     

     

     

     

     

     

     

     

     

  2. Rumen
    Admin
    Rumen avatar
    14392 posts

    Posted 01 May 2017 Link to this post

    Hi Rodney,

    Replace the onkeydown event with the onkeyup one and this should fix the issue.

    Best regards,
    Rumen
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Rodney
    Rodney avatar
    54 posts
    Member since:
    Mar 2015

    Posted 01 May 2017 in reply to Rumen Link to this post

    That worked great, thanks.
Back to Top