I am creating a new ExtJS widget using Ext.view.View. The template for this view needs to have another ExtJS widget inside it.
When a store is associated to the view, the template item rendered on the page would contain another extjs widget.
I could not find any documentation around how to embed another extJS widget inside a template.
If I cannot embed a widget inside a template, is there any way I can associate extjs component and store and render the component per item in the store?
preguntado el 08 de noviembre de 11 a las 18:11
You can't embedded any
Ext.XTemplate, because template just describes html-level logic to render something.
Ext.Component at the same time is much more complex than html string. There are two ways for you to achieve your result
- Add some placeholders to your template. Once template (or view) is rendered, you can find placeholders by
Ext.getmethod and render your components (widgets) to placeholders (by specifying
- Second option is to have some method in
Ext.XTemplatewhich will get your widget and extract some html from it (in case if your widget doesn't have any logic, and simply just an html).