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 - Sr Software Engineer 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
    Sencha Inc, Senior Software Engineer
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    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.

Posting Permissions

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