Results 1 to 3 of 3

Thread: Inherit from non Component class

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Sep 2011
    Vote Rating

    Default Answered: Inherit from non Component class

    I need to inherit from a non-Component class, in my case from TreeStore.
    I would like to handle events. No initComponent method to override, so that I suppose I need to
    override the constructor to wire up my event handlers.

    Can you give me a short sample? Is there any method I must call?
    Is this the right way?

    constructor: function(config) {
      var me = this;
      me.on('move', this.MyMoveHandler);
    Last edited by skirtle; 3 Dec 2011 at 4:59 PM. Reason: Added CODE tags

  2. The overall approach of overriding the constructor is fine. Generally in such circumstances I'd have a read of the superclass's source code to look for a better method to override but from a quick look I don't see a better one for what you're trying to do.

Posting Permissions

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