Change ID of a Component in ExtJS

ExtJS: The Component manager instance’s all collection does not let you change an ID of a component.

Let’s say… you wanted to, anyway. Add this:

Ext.ComponentMgr.all.changeKey = function(oldkey, newkey) {
    var comp = this.map[oldkey];
    var index = this.indexOfKey(oldkey);
    this.keys[index] = newkey;
    this.map[newkey] = comp;
    delete this.map[oldkey];
};

Is there anything really wrong with this approach?

About olleolleolle

Olle is a programmer for hire, enjoying sunny Malmö in Sweden.
This entry was posted in Javascript, Technology and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>