Dummy.js
Role('TestClass.Dummy', {
has: {
Dummy: {
getBacon: function () {
window.alert("I love me some piggy bacon!!!");
}
}
}
});
Class('TestClass', {
isa: Siesta.Test.ExtJS,
does: [
TestClass.Dummy
]
});
Role('TestClass.Dummy', {
has: {
Dummy: {
getBacon: function () {
window.alert("I love me some piggy bacon!!!");
}
}
}
});
Class('TestClass', {
isa: Siesta.Test.ExtJS,
does: [
TestClass.Dummy
]
});
t.dummy.getBacon()
Role('TestClass.Dummy', {
methods: {
methodFromRole: function () {
window.alert("method from role");
}
}
});
Class('TestClass', {
isa: Siesta.Test.ExtJS,
does: [
TestClass.Dummy
],
methods: {
ownMethod: function () {
window.alert("own method");
}
}
});
t.ownMethod()
t.methodFromRole()
Class('TestClass.Dummy', {
has : {
// reference to test
test : null
},
methods: {
methodFromDummy: function () {
window.alert("method from dummy");
this.test.click()
}
}
});
Class('TestClass', {
isa: Siesta.Test.ExtJS,
has : {
// reference to "dummy" instance
dummy : null
},
methods: {
initialize : function () {
this.dummy = new TestClass.Dummy({ test : this })
this.SUPER()
},
ownMethod: function () {
window.alert("own method");
}
}
});
t.ownMethod()
t.dummy.methodFromDummy()
Read the API documentation
Read the API documentation