Hi Karl,

Class.create accepts a base class and multiple mix-ins[1]. The way
JavaScript's instanceof operator works, you can't create a new class
from two disparate base classes and have the new class be an
"instanceof" both of the base classes, you have to choose one as a
base and mix-in the other, but that's fine if the code you quoted is
working for you, nothing is relying on instances of GymnastFind being
"instanceof" Ajax.Application.Base.

So if you want it to derive from GridBuild and mix-in
Ajax.Application.Base:

var GymnastFind = Class.create(GridBuild,
Ajax.Application.Base.prototype);

(Note that for the base class, we specify the class [the constructor
function] rather than the prototype, but mix-ins are specified just as
an object, so we use the prototype of Ajax.Application.Base.)

If you want to specify your own methods as well, just include them as
an object as a third parameter.

[1] http://api.prototypejs.org/language/class.html

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com



On Nov 7, 6:21 pm, kstubs <kst...@gmail.com> wrote:
> The following is working, but I am looking for the pure prototypejs
> equivelant.  So, what would the equivilant code be for
>
> var GymnastFind = Class.create();
> Object.extend(Object.extend(GymnastFind.prototype,
> GridBuild.prototype));
> Object.extend(Object.extend(GymnastFind.prototype,
> Ajax.Application.Base.prototype), {
>     HEAD: ['MSOID', 'USAG', 'Description', 'DOB'],
>     initialize: function(container, url) {
>         this.UserActive = false;
>         this.timer = null;
> ...... code cut here ......
>
> });
>
> In plain English:
>
> Create a GymnastFind Class which inherits from GridBuild class and
> implements the abstract class Ajax.Application.Base.
>
> Thanks,
> Karl..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to