David
David

Reputation: 4283

How to add container multiple time in extjs item of penal

I have a container which I am adding in my item of panel. me.add(Contain);

I wanted to add this container multiple time on some condition. I am using for loop and at end I am writing. panel.doLayout(); It is appearing only one container is adding. Am I missing something. How to old multiple container in item of extjs panel.

Upvotes: 0

Views: 436

Answers (2)

Balram Maurya
Balram Maurya

Reputation: 164

Before add container multiple times in to your panel. Check that container 
you are adding does not have id or itemId as a config property.

So if you want to add that container multiple time you can use that container
with different itemId.
Otherwise it will add only one container and other added container will not
displayed on GUI.

Upvotes: 0

Icepickle
Icepickle

Reputation: 12806

You cannot add the same instance multiple time, think how the rendering system would work as in html the nodes only have 1 parent.

You have to add multiple instance of the container, you could however pass them the same view (if you want to show the same data)

So when you add, you have to create a new version of your container but you could share stores, viewmodel, and other data if you like to

Upvotes: 1

Related Questions