Results 1 to 2 of 2

Thread: [2.2.0-alpha] fireEvent returns 'undefined' if no handler.

Threaded View

Previous Post Previous Post   Next Post Next Post
    Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-4023 in a recent build.
  1. #1
    Sencha User
    Join Date
    Aug 2012
    Vote Rating

    Default [2.2.0-alpha] fireEvent returns 'undefined' if no handler.

    Versions: 2.2.0-alpha (and 2.1.1)
    Browser: Chrome 24 (Win8 / Desktop)
    Severity: normal (workaround: explicitly test fireEvent(...) !== false)
    Attachement: Full test case

    Sencha Touch 2.1 doc says that fireEvent "returns false if any of the handlers return false, otherwise it returns true". If there is no handler attached to the fired event, fireEvent returns 'undefined'. In this case, code checking 'if (fireEvent() == true)', 'if (fireEvent())' or 'if (!fireEvent())' will failed.

    Test case (code extracted from the full test case in attachment)

    PHP Code:
    _fireEvent: function() {
    res this.fireEvent('click'this);
    console.log('fireEvent return:'res);
    PHP Code:
    config: {
    control: {

    // [OK] method returns false, fireEvent returns 'false'
                //'main': { click: function() { return false; } },

                // [OK] method returns nothing, fireEvent returns 'true'
                //'main': { click: function() { } }

                // [FAILED] no bound listeners, fireEvent returns 'undefined'.
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts