Sunday, July 21, 2013

function: initComponent()

In Extjs, sometimes you want to create a component, and use it immediately after creation.

If you're using Ext.define('app.view.blah', {});
it can be really hard find a way to reference an instance of the class you just created.

It took me forever, but all you do is use the
function: initComponent() when placing items into your view.
Since the scope this of the whole function is an instance of the class, you can use the this keyword at the end of the initComponent function.

Interestingly, there is also an afterrender function

No comments:

Post a Comment