Skip to content Skip to sidebar Skip to footer

Extjs: Settings Properties Via A Function On The Prototype: Is It A Safe Pattern?

I am working on a large ExtJS codebase written around ExtJS3 which has a lot of the following initComponent() pattern: Ext.define('PVE.form.BackupModeSelector', { extend: 'PVE.form

Solution 1:

In the first way, you are forcing comboItems value.

In the second, comboItems become available in config, with a default value. That means that you can override it.

var ms = Ext.create('PVE.form.BackupModeSelector', {
    comboItems: [
        // ... someting else
    ]
});

It depends if you want this value exposed to change or not.

Post a Comment for "Extjs: Settings Properties Via A Function On The Prototype: Is It A Safe Pattern?"