0

As mentioned in this Docx Component Life Cycle the template methods like initComponent (initialize -> working), onRender are not invoked when override in the subClass.

Ext.define('My.custom.Component', {
extend: 'Ext.Component',
onRender: function() {
    this.callParent(arguments); // call the superclass onRender method

    // perform additional rendering tasks here.
    }
});

Is there any change in the Component Life cycle for Modern toolkit? If so what is it?

Here is the fiddle

Gowtham S
  • 923
  • 14
  • 39
  • I don't find where this is mentioned; can you please add a quote? I will check later today whether this really is the case, IMO you should be able to override `onRender` like any other method. – Alexander Apr 21 '17 at 06:39
  • check the fiddle with modern and classic... – Gowtham S Apr 21 '17 at 07:22

1 Answers1

0

The guide you found has just been copied from older versions of ExtJS, where modern toolkit was not included; for example, the very same guide was already available in 4.2.2. The concepts do not hold exactly for modern toolkit, although there are similarities.

It seems there is no single event or function that is called for both toolkits. I would recommend to not touch the onRender event unless absolutely necessary, because it has no counterpart in modern. Use either the "constructors" (initComponent/initialize) or listeners (afterrender/painted).

You would have to ask in the Sencha forum whether these differences will be resolved in ExtJS 6.5.

Alexander
  • 19,906
  • 19
  • 75
  • 162