PDA

View Full Version : Ext.dom.AbstractElement - update/setHTML - why do we have identical functions?



LesJ
20 Nov 2013, 8:38 AM
just curious :-?

Ext.define('Ext.dom.AbstractElement', {
...
/**
* Update the innerHTML of this element
* @param {String} html The new HTML
* @return {Ext.dom.Element} this
*/
update: function(html) {
if (this.dom) {
this.dom.innerHTML = html;
}
return this;
},

/**
* Set the innerHTML of this element
* @param {String} html The new HTML
* @return {Ext.Element} this
*/
setHTML: function(html) {
if(this.dom) {
this.dom.innerHTML = html;
}
return this;
},
...

greg.barry
22 Nov 2013, 4:24 PM
I believe they both exist for legacy purposes. They are there to ensure backwards compatibility. Though, they will most likely be merged in the future.

Thanks!
Greg