[Proto-Scripty] Re: Inheritance question

2009-01-15 Thread Cyrus
Thats a good idea. This code works actually. I just cannot (really) override existing methods. If I include methods with the same name in MySortable, they are not called, because within Sortable all methods are called with Sortable.nameOfMethod() - they don't use this.nameOfMethod(). On 14 Jan.,

[Proto-Scripty] Re: Inheritance question

2009-01-14 Thread nlloyds
Cyrus, On Jan 14, 1:50 am, Cyrus arianglan...@googlemail.com wrote: I am seeing myself copying the whole Sortable because it cannot be inherited. I don't know if it's been mentioned, but you since Sortable is just an object you could try extending it with your own methods like this var

[Proto-Scripty] Re: Inheritance question

2009-01-13 Thread Dan
You are confusing constructors with class definition.Class.create() is for defining a new Class which will support inheritance. To construct an instance of a class you defined with var MyClass = Class.create(baseClass, { ... }) you construct it like you would any other object: var

[Proto-Scripty] Re: Inheritance question

2009-01-13 Thread Jerod Venema
If you're trying to avoid the default behaviour for the label (which is to check/uncheck the appropriate form element), you may want to just use prototypes stop [1] function. I've never done this, but something like the following ought to work (I think): Event.observe('mylabel', 'click',

[Proto-Scripty] Re: Inheritance question

2009-01-13 Thread Cyrus
Hi, thanks, but I already tried that yesterday: I like the natural behaviour of the label. In every part of our software you can click on the label to change the status of the checkbox. I just don't like it happen when you use the drag and drop function. Is there a way to stop that event only