I'm writing all my components in ExtJS's new MVC fashion using Ext.define()
.
I struggle a bit whether define properties inside of initComponent()
or by simply setting them like property: 42,
.
Are there widely accepted best practices?
I'm staggering between using initComponent()
only when necessary (ie. when I want something dynamic or set a scope) which keeps the function shorter and spares me some ugly this.
s and using it always which has the benefit, that I'd never have to move former properties to initComponent()
just because I want to make it more dynamic.
Unfortunately, Sencha's docs don't tell much about that and the available examples seem to do as they want.