Is there a way to obtain the underlying object from dom element.
For instance.
- I have a base class which renders some buttons using goog.ui.CustomButton.
- In the child class I want to get underlying goog.ui.CustomButton object through the generated dom element.
Is it possible or do I need to cache the underlying objects:
mylib.Base = function() {
};
mylib.Base.prototype.renderButtons = function(buttonTypes) {
for(var i in buttonTypes) {
var button = new goog.ui.CustomButton();
var buttonContainer = goog.dom.getElement('button-container_' + buttonTypes[i]);
button.render(buttonContainer);
}
};
mylib.Child = function() {
mylib.Base.base(this, 'constructor');
};
goog.inherits(mylib.Child, mylib.Base);
mylib.Super.prototype.someTask = function() {
this.renderButtons(['save_button','cancel_button']);
var saveButtonHolder = goog.dom.getElement('button-container_' + 'save_button');
var saveButtonElement = saveButtonHolder.childern[0]; // Not production code
// Now Is it possible to get the goog.ui.CustomButton object through the
// saveButtonElement ?
};