I finished the job myself. So now I have a template as a property called theTpl , and then it is displayed in beforerender , and then I was able to get the element descriptor in afterrender . It seems completely counter-intuitive, does anyone have an understanding?
beforeRender: { fn: function (me) { me.update(me.theTpl.apply({})); } },
change , I just extended the component like this:
Ext.define('Ext.ux.TemplatedComponent', { extend: 'Ext.Component', alias: 'widget.templatedComponent', template: undefined, beforeRender: function () { var me = this; var template = new Ext.XTemplate(me.template || ''); me.update(template.apply(me.data || {})); me.callParent(); } })
... template accepts an array of html fragments
source share