Ext JS 4.0.7 Sencha Docs

Ext.EventManager

Files

Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides several useful events directly. See Ext.EventObject for more details on normalized event objects.

Available since: 1.1.0

Defined By

Properties

Ext.EventManager
view source
: Numberprivate
...

Defaults to: 0

Available since: 4.0.0

Ext.EventManager
view source
: Numberprivate
Keep track of the current width/height ...

Keep track of the current width/height

Defaults to: 0

Available since: 4.0.0

Ext.EventManager
view source
: Booleanprivate
Check if we have bound our global onReady listener ...

Check if we have bound our global onReady listener

Defaults to: false

Available since: 4.0.0

Ext.EventManager
view source
: Booleanprivate
Check if fireDocReady has been called ...

Check if fireDocReady has been called

Defaults to: false

Available since: 4.0.0

Ext.EventManager
view source
: Booleanprivate
Checks if we have bound an onreadystatechange event ...

Checks if we have bound an onreadystatechange event

Defaults to: false

Available since: 4.0.0

Ext.EventManager
view source
: RegExpprivate
...

Defaults to: /(mouseover|mouseenter)/

Available since: 4.0.0

Ext.EventManager
view source
: RegExpprivate
--------------------- utility methods --------------------- ...

--------------------- utility methods ---------------------

Defaults to: /(mouseout|mouseleave)/

Available since: 4.0.0

Ext.EventManager
view source
: RegExpprivate
Options to parse for the 4th argument to addListener. ...

Options to parse for the 4th argument to addListener.

Defaults to: /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate|freezeEvent)$/

Available since: 4.0.0

Ext.EventManager
view source
: Objectprivate

Holds references to any onReady functions

Holds references to any onReady functions

Available since: 4.0.0

Ext.EventManager
view source
: Objectprivate

Timer for the document ready event in old IE versions

Timer for the document ready event in old IE versions

Available since: 4.0.0

Ext.EventManager
view source
: Objectprivate

Contains a list of all document mouse downs, so we can ensure they fire even when stopEvent is called.

Contains a list of all document mouse downs, so we can ensure they fire even when stopEvent is called.

Available since: 4.0.0

Ext.EventManager
view source
: Objectprivate
note 1: IE fires ONLY the keydown event on specialkey autorepeat note 2: Safari < 3.1, Gecko (Mac/Linux) & Ope...

note 1: IE fires ONLY the keydown event on specialkey autorepeat note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on specialkey autorepeat (research done by Jan Wolter at http://unixpapa.com/js/key.html)

Available since: 4.0.0

Defined By

Methods

Ext.EventManager
view source
( el, eventName, handler, [scope], [options] )
Appends an event handler to an element. ...

Appends an event handler to an element. The shorthand version on is equivalent. Typically you will use Ext.Element.addListener directly on an Element in favor of calling this version.

Available since: 1.1.0

Parameters

  • el : String/HTMLElement

    The html element or id to assign the event handler to.

  • eventName : String

    The name of the event to listen for.

  • handler : Function

    The handler function the event invokes. This function is passed the following parameters:

    • evt : EventObject
      The EventObject describing the event.
    • t : Element
      The Element which was the target of the event. Note that this may be filtered by using the delegate option.
    • o : Object
      The options object from the addListener call.

  • scope : Object (optional)

    The scope (this reference) in which the handler function is executed. Defaults to the Element.

  • options : Object (optional)

    An object containing handler configuration properties. This may contain any of the following properties:

    • scope : Object
      The scope (this reference) in which the handler function is executed. Defaults to the Element.
    • delegate : String
      A simple selector to filter the target or look for a descendant of the target
    • stopEvent : Boolean
      True to stop the event. That is stop propagation, and prevent the default action.
    • preventDefault : Boolean
      True to prevent the default action
    • stopPropagation : Boolean
      True to prevent event propagation
    • normalized : Boolean
      False to pass a browser event to the handler function instead of an Ext.EventObject
    • delay : Number
      The number of milliseconds to delay the invocation of the handler after te event fires.
    • single : Boolean
      True to add a handler to handle just the next firing of the event, and then remove itself.
    • buffer : Number
      Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of milliseconds. If the event fires again within that time, the original handler is not invoked, but the new handler is scheduled in its place.
    • target : Element
      Only call the handler if the event was fired on the target Element, not if the event was bubbled up from a child node.

    See Ext.Element.addListener for examples of how to use these options.

Fires

    Ext.EventManager
    view source
    ( )private
    Binds the appropriate browser event for checking if the DOM has loaded. ...

    Binds the appropriate browser event for checking if the DOM has loaded.

    Available since: 4.0.0

    Ext.EventManager
    view source
    ( ) : Booleanprivate
    Check the ready state for old IE versions ...

    Check the ready state for old IE versions

    Available since: 3.4.0

    Returns

    • Boolean

      True if the document is ready

    Ext.EventManager
    view source
    ( event )private
    Checks whether the event's relatedTarget is contained inside (or is) the element. ...

    Checks whether the event's relatedTarget is contained inside (or is) the element.

    Available since: 4.0.0

    Parameters

    Fires

      Ext.EventManager
      view source
      ( dom, ename, fn, scope, options ) : Functionprivate
      Create the wrapper function for the event ...

      Create the wrapper function for the event

      Available since: 4.0.0

      Parameters

      • dom : HTMLElement

        The dom element

      • ename : String

        The event name

      • fn : Function

        The function to execute

      • scope : Object

        The scope to execute callback in

      • options : Object

        The options

      Returns

      Ext.EventManager
      view source
      ( )private
      We know the document is loaded, so trigger any onReady events. ...

      We know the document is loaded, so trigger any onReady events.

      Available since: 4.0.0

      Ext.EventManager
      view source
      ( )private
      Fire the resize event. ...

      Fire the resize event.

      Available since: 4.0.0

      Ext.EventManager
      view source
      ( )private
      Fires the unload event for items bound with onWindowUnload ...

      Fires the unload event for items bound with onWindowUnload

      Available since: 4.0.0

      Fires

        Ext.EventManager
        view source
        ( element ) : Objectprivate
        Gets the event cache for the object ...

        Gets the event cache for the object

        Available since: 4.0.0

        Parameters

        • element : HTMLElement

          The element

        Returns

        • Object

          The event cache for the object

        Fires

          Ext.EventManager
          view source
          ( element, eventName ) : Arrayprivate
          Get the event cache for a particular element for a particular event ...

          Get the event cache for a particular element for a particular event

          Available since: 4.0.0

          Parameters

          • element : HTMLElement

            The element

          • eventName : Object

            The event name

          Returns

          • Array

            The events for the element

          Fires

            Ext.EventManager
            view source
            ( element ) : String
            Get the id of the element. ...

            Get the id of the element. If one has not been assigned, automatically assign it.

            Available since: 4.0.0

            Parameters

            • element : HTMLElement/Ext.Element

              The element to get the id for.

            Returns

            Ext.EventManager
            view source
            ( ) : String
            Indicates which event to use for getting key presses. ...

            Indicates which event to use for getting key presses.

            Available since: 4.0.0

            Returns

            • String

              The appropriate event name.

            Ext.EventManager
            view source
            ( event ) : Number
            Gets the x coordinate from the event ...

            Gets the x coordinate from the event

            Available since: 4.0.0

            Parameters

            Returns

            Fires

              Ext.EventManager
              view source
              ( event ) : Number[]
              Gets the x & y coordinate from the event ...

              Gets the x & y coordinate from the event

              Available since: 4.0.0

              Parameters

              Returns

              Ext.EventManager
              view source
              ( event ) : Number
              Gets the y coordinate from the event ...

              Gets the y coordinate from the event

              Available since: 4.0.0

              Parameters

              Returns

              Fires

                Ext.EventManager
                view source
                ( event ) : HTMLElement
                Gets the related target from the event. ...

                Gets the related target from the event.

                Available since: 4.0.0

                Parameters

                Returns

                • HTMLElement

                  The related target.

                Fires

                  Ext.EventManager
                  view source
                  ( event ) : HTMLElement
                  Gets the target of the event. ...

                  Gets the target of the event.

                  Available since: 4.0.0

                  Parameters

                  Returns

                  • HTMLElement

                    target

                  Fires

                    Ext.EventManager
                    view source
                    ( eventName, fn ) : Objectprivate
                    Normalize cross browser event differences ...

                    Normalize cross browser event differences

                    Available since: 4.0.0

                    Parameters

                    • eventName : Object

                      The event name

                    • fn : Object

                      The function to execute

                    Returns

                    • Object

                      The new event name/function

                    Ext.EventManager
                    view source
                    ( )
                    Alias for Ext.EventManager.addListener ...

                    Alias for Ext.EventManager.addListener

                    Available since: 1.1.0

                    Ext.EventManager
                    view source
                    ( fn, [scope], [options] )
                    Adds a listener to be notified when the document is ready (before onload and before images are loaded). ...

                    Adds a listener to be notified when the document is ready (before onload and before images are loaded). Can be accessed shorthanded as Ext.onReady().

                    Available since: 1.1.0

                    Parameters

                    • fn : Function

                      The method the event invokes.

                    • scope : Object (optional)

                      The scope (this reference) in which the handler function executes. Defaults to the browser window.

                    • options : Boolean (optional)

                      Options object as passed to Ext.Element.addListener.

                    Ext.EventManager
                    view source
                    ( fn, scope, options )
                    Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 millisecon...

                    Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 milliseconds), passes new viewport width and height to handlers.

                    Available since: 1.1.0

                    Parameters

                    • fn : Function

                      The handler function the window resize event invokes.

                    • scope : Object

                      The scope (this reference) in which the handler function executes. Defaults to the browser window.

                    • options : Boolean

                      Options object as passed to Ext.Element.addListener

                    Fires

                      Ext.EventManager
                      view source
                      ( )private
                      ...

                      Available since: 4.0.0

                      Fires

                        Ext.EventManager
                        view source
                        ( element, event, isRemove )private
                        Convert a "config style" listener into a set of flat arguments so they can be passed to addListener ...

                        Convert a "config style" listener into a set of flat arguments so they can be passed to addListener

                        Available since: 4.0.0

                        Parameters

                        • element : Object

                          The element the event is for

                        • event : Object

                          The event configuration

                        • isRemove : Object

                          True if a removal should be performed, otherwise an add will be done.

                        Ext.EventManager
                        view source
                        ( The )
                        Prevents the browsers default handling of the event. ...

                        Prevents the browsers default handling of the event.

                        Available since: 4.0.0

                        Parameters

                        • The : Event

                          event to prevent the default

                        Ext.EventManager
                        view source
                        ( el, [eventName] )
                        Recursively removes all previous added listeners from an element and its children. ...

                        Recursively removes all previous added listeners from an element and its children. Typically you will use Ext.Element.purgeAllListeners directly on an Element in favor of calling this version.

                        Available since: 4.0.0

                        Parameters

                        • el : String/HTMLElement

                          The id or html element from which to remove all event handlers.

                        • eventName : String (optional)

                          The name of the event.

                        Fires

                          Ext.EventManager
                          view source
                          ( el )
                          Removes all event handers from an element. ...

                          Removes all event handers from an element. Typically you will use Ext.Element.removeAllListeners directly on an Element in favor of calling this version.

                          Available since: 2.3.0

                          Parameters

                          • el : String/HTMLElement

                            The id or html element from which to remove all event handlers.

                          Fires

                            Ext.EventManager
                            view source
                            ( el, eventName, fn, scope )
                            Removes an event handler from an element. ...

                            Removes an event handler from an element. The shorthand version un is equivalent. Typically you will use Ext.Element.removeListener directly on an Element in favor of calling this version.

                            Available since: 1.1.0

                            Parameters

                            • el : String/HTMLElement

                              The id or html element from which to remove the listener.

                            • eventName : String

                              The name of the event.

                            • fn : Function

                              The handler function to remove. This must be a reference to the function passed into the addListener call.

                            • scope : Object

                              If a scope (this reference) was specified when the listener was added, then this must refer to the same object.

                            Fires

                              Ext.EventManager
                              view source
                              ( fn, scope )
                              Removes the passed window resize listener. ...

                              Removes the passed window resize listener.

                              Available since: 1.1.0

                              Parameters

                              • fn : Function

                                The method the event invokes

                              • scope : Object

                                The scope of handler

                              Ext.EventManager
                              view source
                              ( fn, scope )
                              Removes the passed window unload listener. ...

                              Removes the passed window unload listener.

                              Available since: 4.0.0

                              Parameters

                              • fn : Function

                                The method the event invokes

                              • scope : Object

                                The scope of handler

                              Fires

                                Ext.EventManager
                                view source
                                ( node ) : HTMLElementprivate
                                Resolve any text nodes accounting for browser differences. ...

                                Resolve any text nodes accounting for browser differences.

                                Available since: 4.0.0

                                Parameters

                                • node : HTMLElement

                                  The node

                                Returns

                                • HTMLElement

                                  The resolved node

                                Ext.EventManager
                                view source
                                ( The )
                                Stop the event (preventDefault and stopPropagation) ...

                                Stop the event (preventDefault and stopPropagation)

                                Available since: 4.0.0

                                Parameters

                                • The : Event

                                  event to stop

                                Fires

                                  Ext.EventManager
                                  view source
                                  ( The )
                                  Cancels bubbling of the event. ...

                                  Cancels bubbling of the event.

                                  Available since: 4.0.0

                                  Parameters

                                  • The : Event

                                    event to stop bubbling.

                                  Ext.EventManager
                                  view source
                                  ( )
                                  Alias for Ext.EventManager.removeListener ...

                                  Alias for Ext.EventManager.removeListener

                                  Available since: 1.1.0