Results 1 to 3 of 3

Thread: Migrating ExtJS4->6 : how to override parent listeners ?

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    41
    Answers
    2

    Default Migrating ExtJS4->6 : how to override parent listeners ?

    Hello,
    I am currently trying to migrate a ExtJs4 application to ExtJs6 and have some issue to reproduce old parent listener overriding. What should i do to refactor my child listeners to override the parent ones please ?

    Code:
    Ext.define(‘BaseClass’, {
    Code:
      extend: ‘Ext.Component’,
      listeners: {
        foo: function() {
          console.log(‘foo fired’);
        }
      }
    });
    var instance = new BaseClass({
      listeners: {
        // here i want only execute this code and not the BaseClass one.
        foo: function() {
          console.log(‘baz fired’);
        }
      }
    });

    I think some other customers could be interesting too. Only thing i could find in docs was : ” Users who were dependent upon the past behavior of declarative listeners that overrode their parent classes’ listeners will need to change their code to override the handler method instead.”
    But i don't know how to do that.

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    I'm guessing this is the page to which you are referring, and that you've read the Declarative Listeners section.
    http://docs.sencha.com/extjs/5.0/upg...tive_Listeners

    Perhaps this blog post will help:
    https://www.sencha.com/blog/declarat...s-in-ext-js-5/

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Posts
    41
    Answers
    2

    Default

    Hello, thank you for your answer. Sadly i already read all that documentation and still couldn't find a solution. I fall on other problems for migrating so we decided to restart from scratch...

Similar Threads

  1. Replies: 2
    Last Post: 20 Jan 2015, 2:30 PM
  2. Fit to parent plugin available for Extjs4?
    By renganathan in forum Ext: Q&A
    Replies: 11
    Last Post: 6 Aug 2013, 9:33 AM
  3. Problem Migrating from Extjs 3 to Extjs4
    By Himansu in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 14 Aug 2012, 6:18 AM
  4. Controller.control listeners override each other.
    By dogomatic in forum Ext:Bugs
    Replies: 0
    Last Post: 17 Apr 2011, 11:28 AM

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
  •