[CLOSED] HTML Editor - Change Event ?

  1. #1

    [CLOSED] HTML Editor - Change Event ?

    Hi all

    I'm looking for a way to check the input length of a HTML Editor. The check should be done on each keystroke...
    I found the 'change' Event in the Ext.JS doc's (http://docs.sencha.com/extjs/5.0.1/#...r-event-change)

    Is this Event also available for Ext.Net ? Can't find him...
    Is there a workaround ?

    Peter
    Last edited by Daniil; Sep 15, 2015 at 8:29 AM. Reason: [CLOSED]
  2. #2
    Hi Peter,

    Ext.NET v2 is based on ExtJS 4, not ExtJS 5.

    Though, there is the change event in ExtJS 4 docs as well.
    http://docs.sencha.com/extjs/4.2.1/s...eld-HtmlEditor

    But it never worked as developers need. It doesn't fire when a user types inside. It fires only on .setValue() which is actually documented in ExtJS docs.

    This thread might help you.
    http://forums.ext.net/showthread.php?19358

    It is for Ext.NET v1, though. Some changes (I guess, slight changes) might be required to get it working with Ext.NET v2.
  3. #3
    Hi Daniil

    I tried the Example as it is and it doesn't trigger an event ?

    I changed the code a bit

          var onInitialize = function (ed) {
    
                ed.items.each(function (item) {
    
                  item.on("click", function () {
                        alert(this.itemId);
                  });
    
                });
    
            };
    Do I have to change something else?

    Peter
    Last edited by xtoolz; Sep 13, 2015 at 4:52 PM.
  4. #4
    I guess you are dealing with this example.
    http://forums.ext.net/showthread.php...ll=1#post83413

    With Ext.NET v3 tb should be replaced with toolbar.

    Here is an example.

    Example
    <%@ Page Language="C#" %>
      
    <!DOCTYPE html>
     
    <html>
    <head runat="server">
        <title>Ext.NET v3 Example</title>
     
        <script type="text/javascript">
            var onInitialize = function (htmlEditor) {
                htmlEditor.toolbar.items.each(function (item) {
                    item.on("click", function () {
                        alert(this.itemId);
                    });
                });
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:HtmlEditor ID="HtmlEditor1" runat="server">
                <Listeners>
                    <Initialize Fn="onInitialize" />
                </Listeners>
            </ext:HtmlEditor>
        </form>
    </body>
    </html>
    If click on the toolbar's buttons, the Click event fires. But... is it what you are looking for? I guess I referenced a wrong thread. Please have a look at this one instead.
    http://forums.ext.net/showthread.php?19353
  5. #5
    This modification works - but it is not what I'm looking for :-)
    I need to check the current text length in the HTML Editor - any Idea for that ?
  6. #6
    Maybe App.HtmlEditor1.getValue().length?
  7. #7
    Sorry, I didn't explain it clearly - I need the length while tipping in the text (kind of SMS Style on Mobile Phones 'Remaining 7 of 157 Characters')
  8. #8
    Then please review:
    Please have a look at this one instead.
    http://forums.ext.net/showthread.php?19353
  9. #9
    PERFECT !
    Works fine :-)

Similar Threads

  1. Replies: 3
    Last Post: Nov 01, 2013, 9:28 PM
  2. Replies: 1
    Last Post: Jan 28, 2013, 11:45 PM
  3. [CLOSED] HTML edito text change and focus event.
    By RCM in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 20, 2012, 5:02 PM
  4. [CLOSED] Blur event for HTML Editor
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 03, 2011, 1:40 PM
  5. How to change default font of HTML Editor
    By VietView in forum 1.x Help
    Replies: 0
    Last Post: Mar 25, 2009, 8:22 AM

Posting Permissions