Results 1 to 2 of 2

Thread: class question

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Vote Rating

    Default class question

    watching the sencha video of the new class system I am still confused about some things:
    1. the lifecycle of the objects: the video shows the use of the constructor method. looking at the sencha 2 code there's some code that uses initialize method (not sure what it does).
    2. video shows using .initConfig(config); inside the constructor for the benefit of get/set/apply/etc. this worked for me for a component that does not inherit anything, once I used 'extend: ext.container' I got an exception (see below)
    3. looking at some sencha code and extensions I mostly saw people using callparent([config]). is this the same?
    4. I am somewhat confused and would appreciate your help


  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    constructor is the initial method that gets called when creating a component. initialize happens a little later so it just depends on what you need to do and where you can do it.

    initConfig(config) will create the getters/setters and such but a component should have that called automatically so you may not have to. I would check to see if it is already there before I would call initConfig.

    callParent will call the class that you are extending method so you don't loose functionality.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:

Posting Permissions

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