Results 1 to 2 of 2

Thread: Best practices for configuration option that is an array?

  1. #1
    Ext JS Premium Member
    Join Date
    Oct 2010
    Vote Rating

    Question Best practices for configuration option that is an array?

    I am porting a couple of applications and libraries over to ST2, and am really liking what I see. I have run into a bit of a question on the configuration system though. I have a custom component that is configured with a list of item configurations. I am not sure how to handle array values.

    Are their any recommended best practices for configuration options that are arrays?

    For example when adding an item to an array, it seems like you would call getMyItems() and then call push on it, but this would skip all the infrastructure for apply and update methods. How should this be handled with the new configuration system?

    Also, in the previous class I had to initialize my configuration item list with a value of null to make sure it didn't get reused (ie. shared) across class instantiations. Is this handled automatically by the configuration system now, or do I need to do something explicit to make sure that default values don't get shared across multiple instances?

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


    For items, if you want to add an item anywhere you can use the add/insert method. For custom ones, you can push to the array but I would then execute the set method with that new array. Then in the apply or update method you can take action on that array.
    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:

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