PDA

View Full Version : [4.0.7] setter & getter - callParent for other method



michall
24 Jan 2012, 11:09 PM
Hello,

is there any way to get parent object to call some method on it (other than callParent calls) ? Some example:


set: function() {
// this.callParent( arguments );
},
setStartDate: function() {
// by callParent I can call only setStartDate parent, how to call parent get
// eg: this.getParent().set() ?
}

vadimv
24 Jan 2012, 11:27 PM
I used once in one piece of code the first example, not sure if it's a good approach but works:


set: function(){
this.callParent(arguments);
}

michall
24 Jan 2012, 11:30 PM
CallParent works I know that, I want to call set method parent from other one - eg setStartDate see example.

vadimv
25 Jan 2012, 1:57 AM
have you tried "object.superclass.method()"

michall
25 Jan 2012, 10:41 PM
have you tried "object.superclass.method()"
This do the job, this.superclass.method.call( this ) is even better ;-) thanks.