Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Ext.Component.initialConfig, what does it do, and in what context is it used?

Tags:

extjs

When does initialConfig get called? What's the difference between it and initComponent?

like image 449
ppecher Avatar asked Feb 08 '11 22:02

ppecher


People also ask

What is component in Ext JS?

An Ext JS application's UI is made up of one or many widgets called Components. All Components are subclasses of the Ext. Component class which allows them to participate in automated lifecycle management including instantiation, rendering, sizing and positioning, and destruction.

What is Ext getCmp?

getCmp. will return you an item matching the id you passed it. This will be the fastest method to return an item. All items when created with an id are registered in a single object using their id as a key.

What is render in Ext JS?

Column renderers give us the ability to customize the behavior and rendering of the cells inside a grid's panel. A renderer is tied to a particular column, and will run for each cell that it has to display/create in that column. In the Ext JS library, many renderers are already set inside the Ext.


1 Answers

initialConfig never gets called, because it is not a function. It's the configuration object, that was used to configure the component when it was actually created.

For example when you do:

var textField = new Ext.form.TextField({
  fieldLabel: 'A textfield',
  itemId: 'textField'
});

the

{
  fieldLabel: 'A textfield',
  itemId: 'textField'
}

object becomes a read only property textField.initialConfig

initComponent() is a private function, that is responsible for configuring the component during creation.

like image 162
Mchl Avatar answered Nov 15 '22 10:11

Mchl