List Info

Thread: how to extend existing methods functionality in scriptaculous




how to extend existing methods functionality in scriptaculous
user name
2008-01-03 06:51:36
Hello All,

I'm new to javascript and scriptaculous so I wanted to ask
gurus about
CORRECT way of extending already existing methods. Here is
my example:

we have:
Autocompleter.updateElement() {

...
if (this.options.afterUpdateElement)
      this.options.afterUpdateElement(this.element,
selectedElement);
}

Let's say I want to "submit form" right after user
select new value in
Autocompleter field. What the CORRECT way to accomplish
that? I need
to make something similar to:

function newAfterUpdateElement() {
 .... <do my actions here>...
return this.oldAfterUpdateElement();
}

Autocompleter.prototype.options.oldAfterUpdateElement=Autoco
mpleter.prototype.options.afterUpdateElement;
Autocompleter.prototype.options.afterUpdateElement=newAfterU
pdateElement;

thanks,

bigral
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffsgooglegroups.com
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=
en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )