Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-7174 in 4.1.4.
  1. #1
    Sencha Premium Member
    Join Date
    Jun 2012
    Location
    Auckland, New Zealand
    Posts
    6
    Vote Rating
    1
    walter.rumsby is on a distinguished road

      0  

    Default Ext.util.Point.fromEvent Doesn't Accept Ext.EventObject

    Ext.util.Point.fromEvent Doesn't Accept Ext.EventObject


    The documentation for Ext.util.Point notes that you can use the static method fromEvent like this:

    Code:
    var point = Ext.util.Point.fromEvent(e);
    Handy, but if I have:

    Code:
    el.on('click', function(e) {
        var point = Ext.util.Point.fromEvent(e);
        ...
    });
    the Point is not initialized properly. The problem appears to be that e is an instance of Ext.EventObject and that fromEvent will only accept a DOM Event.

    It would be nice if fromEvent could accept either a DOM Event or an instance of Ext.EventObject. Yes, people can use e.getPoint(), but I think one or both of the following changes should be made:

    * Update the documentation for Ext.util.Point.fromEvent to mention that you can call Ext.EventObject.getPoint
    * Support passing both DOM Event objects or Ext.EventObject instances to Ext.util.Point.fromEvent

    Test case: http://jsfiddle.net/wrumsby/9YF3u/

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,004
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    This has been fixed for 4.1.3
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread