You could use Class.refactor from -more.
Request = Class.refactor(Request, {
onFailure: function(){
this.previous();
// your own stuff
}
});
Now all Requests get it.
On Feb 1, 2011, at 8:10 AM, Serkan Temizel wrote:
> Hi there,
>
> The title may a bit complicated :) Here is the case;
>
> I extend Request class for my special needs
>
> var MyRequest = new Class({
> Extends: Request,
> onFailure: function(){
> //my own failure handling stuff
> }
> });
>
> I also extend Request.JSON class
>
> MyRequest.JSON= new Class({
> Extends: Request.JSON
> });
>
>
> By default Request.JSON extends Request Class.
> I just extended and added special functionaltiy to Request as MyRequest.
> And now I want my MyRequest.JSON to extend Request.JSON as if it is extended
> from MyRequest to use it's new functionality.
>
>
> In other words;
>
> When I extend MyRequest.JSON from Request.JSON I cant use the functionality
> in MyRequest because Request.JSON extends Request, not MyRequest
>
>
> Serkan