Reputation: 3442
This is the ExtJS Shape Class:
Ext.define('Ext.chart.Shape', {
singleton: true,
circle: function (surface, opts) {
return surface.add(Ext.apply({
type: 'circle',
x: opts.x,
y: opts.y,
stroke: null,
radius: opts.radius
}, opts));
},
...
});
I want to add a method to this Class. For example:
myCircle: function (surface, opts) {
return ...
},
How can I do this?
Upvotes: 3
Views: 3980
Reputation: 3442
I found the answer. This is the solution if someone needs it:
Ext.define('MyShape', {
override: 'Ext.chart.Shape',
initialize: function() {
this.callOverridden(arguments);
},
myCircle: function (surface, opts) {
return ...
}
});
Upvotes: 3
Reputation: 526
You can extend to add new functions, or override to change behaviour of existing functions on a class. Links below are for the details in the sencha documentation explaining how to use them.
Sample implementation of extend:
Ext.define('yourCustomClassHere', {
extend: 'Ext.chart.Shape',
newFunctionName: function () {
//your function here
}
});
Upvotes: 2