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

Display MaxTextLength in footer

5 Answers 43 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 02 Feb 2011, 02:56 PM
I am using the RadEditorStatistics module.  Is it possible to display the MaxTextLength in the footer of the window so it shows something like:

Words: 40 Characters: 252 of 1250

where 1250 is MaxTextLength

Thanks.  If not, this would be a very nice thing to add.

Michael Grant

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Feb 2011, 03:05 PM
Hi Michael,

Please, try the following code:

<telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad"></telerik:RadEditor>
<script type="text/javascript">
    function OnClientLoad(editor) {
        var bottomZone = $get(editor.get_id() + "Bottom");
        var span = document.createElement("SPAN");
        span.innerHTML = "Max Text Length: 100";
        bottomZone.firstChild.appendChild(span);
    }
</script>

Best regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Michael
Top achievements
Rank 1
answered on 02 Feb 2011, 04:19 PM
First, this does not seem to work, the footer is not modified.

Second, if we can get this to work, is there some way to read the MaxTextLength from the object in JavaScript so that this can be generic and used with any instance of the Rad Editor?

Michael Grant
0
Rumen
Telerik team
answered on 04 Feb 2011, 01:21 PM
Hi Michael,

Yes, you can read the MaxTextLength from the object in JavaScript using the editor's editor.get_maxTextLength(); method. For your convenience I rewrote the Statistics module and add an extra Max Text Length field in it. I attached my test page.


Greetings,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Michael
Top achievements
Rank 1
answered on 04 Feb 2011, 04:34 PM
Hi Rumen,

I tried your module and I must admit that I can not make it work!

I have attached the page (it's a control actually) which contains the editor.  I inserted your code on to the page and it doesn't show anything at the bottom of the editor.  I even tried moving the javascript code to the main page which includes this control.

Will you be integrating this change in an upcoming version of the Status Module?

Michael
0
Rumen
Telerik team
answered on 09 Feb 2011, 05:16 PM
Hello Michael,

Please, find attached a sample working project and a video demonstrating the provided solution: http://screencast.com/t/FJiiLKNZhC. You can use the project as a base to implement your scenario.

Best regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
Michael
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Michael
Top achievements
Rank 1
Share this question
or