Threaded View
-
1 Dec 2012 3:37 AM #1
[2.1] Class creation inconsistency
[2.1] Class creation inconsistency
Test case:
So, we have two classes- 'component' and my anonymous class.Code:var d = (new Ext.Class({ config: { test: 'action' }, constructor: function (config) { this.initConfig(config); } })).create({action:'test'}); var d1= Ext.widget('component', {action:'test'});
Ext.define(null,{}) not working in sencha touch but in extjs work perfectly
.
I have created two instances of corresponding classes named 'd1' and 'd'.
Now "interesting" behavior.
1) d1.action=='test'
but
2) d.action==undefined
framework classes is somehow differ?
d1.config and d.config both contain 'action' property.
But in 'component' case it also defined as instance property(chrome browser).
That inconsistency is critical, because in case of native build (for ios), 'component' does not define instance property- same behavior as my custom class.
But in chrome browser 'action" is visible as instance property!
So,question is-what's correct behavior from javascript perspective regardless of browser details?
Should 'action' (not config property!!!) be defined as instance property or be available only through 'config' object?
What's definition of instance properties,not confusing with config properties? Does dynamic nature of javascript still intact?
By the way, some_container.down('component[action]') still find instance I need,though 'action' is not visible as instance property in iOs=native case.Strange things happen...
Thanks.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote