View Full Version : 2 items with same id

9 Sep 2011, 11:46 PM
A very basic question.
I have a Ext.window. In that I put a grid with id 'grid1'.
What happens if I put another grid with the same id in the window?
Does the first grid get destroyed or the id of the first grid get changed?

10 Sep 2011, 3:24 AM
I think this is not possible. Id is allways unique and by pasing 2 elements with the same Id coused an error or your page stop rendering from that point on.

greets streha

10 Sep 2011, 5:51 AM
It's possible and this is why I (and many others) have always talked against using id.

If you have two Components with the same id, the first will not get destroyed but will be lost. Things get put into the ComponentMgr so last one to be created will be the only one tracked by ComponentMgr. The first will still be rendered and usable but won't be tracked.