[Dojo-interest] extending postCreate()

Thomas Wolf tw at wsf.at
Wed Feb 14 15:44:57 MST 2007


Hi,

If I want to extend a widgets's postCreate() method
preserving the old postCreate() - is this the right
approach?

var old=dojo.widget.ModalFloatingPane.prototype.postCreate;
dojo.widget.ModalFloatingPane.prototype.oriPostCreate=old;

dojo.widget.ModalFloatingPane.prototype.postCreate=function() {
     // do something...
     this.oriPostCreate();
};

Seems to work, but is this the correct 'dojo-way'? Any pitfalls?

Thanks in advance for any comment
Thomas



More information about the Dojo-interest mailing list