Results 1 to 2 of 2

Thread: Custom views: when to use config?

  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2010
    Location
    Omaha, NE
    Posts
    628
    Vote Rating
    40
      0  

    Default Custom views: when to use config?

    So several of us here are trying to figure out when properties should go into config and when they should be at the class level? A lot of the examples show the entire view being built inside config. It appears this doesn't work with dynamic data but maybe we're missing something? For dynamic views we are doing:

    Code:
    config: {}
    initialize: funciton() {
        this.setItems(this.buildItems());
    }
    buildItems: function() {
        return { view stuff }
    }
    So is there an easy rule of thumb on what does into config and what goes at the class level? We thought maybe anything that could be changed after creation goes into config. Maybe there's a good write up on this and we just haven't found it?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,416
    Vote Rating
    1269
      0  

    Default

    The config object is great if you want the whole getter/setter architecture that comes along with them. That's the thing that I use it most for. I put everything in the config personally.
    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
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    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
  •