0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Ext.factoryでのconfigとclassReference

Last updated at Posted at 2013-11-05

【メモ】の内容を忘れないためだけに記録

Ext.factory

factory( config, classReference, [instance], [aliasNamespace] )

Parameters

  • config : Object
    The config object to instantiate or update an instance with.
  • classReference : String
    The class to instantiate from.
  • instance : Object (optional)
    The instance to update.
  • aliasNamespace : String (optional)

Documentより

以下2つは等価

Ext.factory({ text: 'My Button' }, 'Ext.Button');
Ext.create('Ext.Button', { text: 'My Button' });

buttonがすでに作成済みの場合、buttonがconfigの内容で更新される。
(button.setConfig(config)が実行される=Modelで使用してもフィールドは更新されない)

var button;
// Button created
button = Ext.factory({ text: 'New Button' }, 'Ext.Button', button);
// Button updated
button = Ext.factory({ text: 'Updated Button' }, 'Ext.Button', button);

【メモ】configとclassReferenceの関係

configにxtypeを含む場合classReferenceよりもそのタイプが優先される。
また、buttonが作成済みの場合、button.destroyが内部で実行される。

con = Ext.factory({xtype: 'container', text: 'This is Ext.Container' }, 'Ext.Button', button);
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?