27 Oct 2011 3:16 AM #1
Changes to config access
In previous versions, I sometimes accessed config like this:
This no longer works. In 4.1, it appears that any of the following would work...
...but I don't want to rely upon undocumented behavior (again). Method #1 is the only one I see mentioned explicitly in the docs, but for config used within methods called many times, I prefer a non-method access mechanism. Is #2 also safe?
28 Oct 2011 12:34 AM #2
Thanks for the report. This was the result of an incorrect merge from Touch 2 and we are going to restore the 4.0 semantics for configs as best we can. The only change I expect that will carry forward is that the default config value will be set via the setter to allow it to be (potentially) transformed.
The impact of this is in the timing of the first call to the setter which might matter if your setting does things like navigate the component hierarchy (directly via ownerCt or indirectly via up/down/etc).
You should not have to resort to _foo or getFoo: using getters for all property accesses is a useless overhead and inconsistent with (most) existing config properties in Ext JS itself. If you need to revert this for your testing, you can remove the "'_'+" from "internal: '_'+name" in ext-all(-debug). Look for "registerProcessor('config', function"...
28 Oct 2011 1:35 AM #3
I think you meant "registerPreprocessor('config, function'".
28 Oct 2011 10:02 AM #4
28 Oct 2011 1:42 PM #5
Understood. Thanks. The workaround is helpful...