[CLOSED] http://examples.ext.net/#/Toolbar/StatusBar/Overview/ Character count

  1. #1

    [CLOSED] http://examples.ext.net/#/Toolbar/StatusBar/Overview/ Character count

    Hello!

    I am trying to copy the character count bottom bar from https://examples1.ext.net/#/Toolbar/StatusBar/Overview/, but looks like a js error is showing up.

    Can you guys have a look, please?

    Thanks
    Last edited by geoffrey.mcgill; May 12, 2011 at 4:53 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Thank you for the report.

    To fix please replace 'el' with 'this' in KeyDown listener.
    <KeyDown 
        Handler="var v = this.getValue(),
  3. #3
    No problemo. I was trying to add the statusbar to the htmleditor, but I just found out, htmleditors dont have top or bottom bars.

    Thanks, please, mark as solved.
  4. #4
    Well, there is another problem. StatusBar you could place anywhere.

    I can provide you with the example which almost works good:) But I would recommend you to give up this idea - HtmlEditor is rather specific control and depends on browser. Something is not under us control, so, implementing this feature can take a lot of development time with no success.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:Panel runat="server" Width="800" Layout="FitLayout">
            <Items>
                <ext:HtmlEditor runat="server" EscapeValue="false">
                    <Listeners>
                        <Initialize Handler="var fn = function () {
                                                var v = this.getValue(),
                                                    wc = 0, cc = v.length ? v.length : 0;
                                                    
                                                    if (cc &gt; 0) {
                                                        wc = v.match(/\b/g);
                                                        wc = wc ? wc.length / 2 : 0;
                                                    }
                                                    
                                                    #{wordCount}.setText('Words: ' + wc);
                                                    #{charCount}.setText('Chars: ' + cc); 
                                              };
                                              
                                              fn = fn.createDelegate(this);
                                              Ext.EventManager.on(this.getDoc(), {
                                                keyup : fn
                                              });
                                              this.setValue('');" />
                    </Listeners>
                </ext:HtmlEditor>
            </Items>
            <BottomBar>
                <ext:StatusBar runat="server" DefaultText="Ready">
                    <Items>
                        <ext:ToolbarFill runat="server" />
                        <ext:ToolbarTextItem ID="wordCount" runat="server" Text="Words: 0" />
                        <ext:ToolbarSeparator runat="server" />
                        <ext:ToolbarTextItem ID="charCount" runat="server" Text="Chars: 0" />
                    </Items>
                </ext:StatusBar>
            </BottomBar>
        </ext:Panel>
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 3
    Last Post: Apr 10, 2012, 2:20 PM
  2. Replies: 2
    Last Post: Jun 24, 2011, 5:33 PM
  3. Replies: 2
    Last Post: Feb 18, 2011, 10:27 AM
  4. http://examples.ext.net/ can not be accessed!
    By Santon_Lee in forum 1.x Help
    Replies: 1
    Last Post: Nov 04, 2010, 4:34 AM
  5. more error in http://examples.ext.net
    By maxdiable in forum 1.x Help
    Replies: 0
    Last Post: Jun 11, 2010, 5:21 PM

Tags for this Thread

Posting Permissions