PDA

View Full Version : A small problem, something about extends



safewolf
3 Jan 2011, 7:11 PM
hi, everyone

i have read some codes about the extjs

but something confused me.

when i create my own class, which is extend from some existing class

i can add my own functions like this:




MyClass = function(){

//private
myPrivate1 = function()
{
}

//public
myPublic1 = function()
{
}

this.myFunction = function()
{
}

MyClass.superClass.constructor.call(this,{});

}

Ext.extend(MyClass,SomeExstingClass,{
myFunction : function()
{
}

})


so, the questions is that

is there any differences between the 4 functions?

6 Jan 2011, 2:37 PM
please post properly formatted code


MyClass = function () {

//private
myPrivate1 = function () {}

//public
myPublic1 = function () {}

this.myFunction = function () {}

MyClass.superClass.constructor.call(this, {});

}

Ext.extend(MyClass, SomeExstingClass, {
myFunction: function () {}

})

6 Jan 2011, 2:40 PM
http://tdg-i.com/img/screencasts/2011-01-06_1738.png