Chaitanya
Chaitanya

Reputation: 2444

ExtJS widget inside a view

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?

Thanks

Upvotes: 1

Views: 1466

Answers (1)

Pavel Podlipensky
Pavel Podlipensky

Reputation: 8269

You can't embedded any Ext.Component inside 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

  1. Add some placeholders to your template. Once template (or view) is rendered, you can find placeholders by Ext.get method and render your components (widgets) to placeholders (by specifying renderTo property)
  2. Second option is to have some method in Ext.XTemplate which 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).

Upvotes: 3

Related Questions