PDA

View Full Version : Position of config params in a class extension



cathogeek
1 Nov 2009, 3:01 PM
Hi,

I don't understand the difference between these two codes :



App.MyClass = Ext.extend(Ext.SomeClass, {

constructor: function(config)
{
config = Ext.apply({

myParam: 'myValue',

otherParam: 'otherValue'
}, config);
App.MyClass.superclass.constructor.call(this, config);
}
});


App.MyClass = Ext.extend(Ext.SomeClass, {

myParam: 'myValue',

constructor: function(config)
{
config = Ext.apply({
otherParam: 'otherValue'
}, config);
App.MyClass.superclass.constructor.call(this, config);
}
});
After reading some topics and tutorials, I noted that, in the first example, the param myParam is read only.
But what else ?

In some cases, in the first example, the param is NOT recognized by ExtJS.
No error, but the param has no effect...

For example, in a Ext.data.Reader, params root and totalResults ; or in a Ext.grid.GridPanel, params colModel.

Have you any idea about it ?
Thanks !
--
François Nautré