如何在自定义javascript文件中覆盖以下操作定义?
Ext.define("my.action.form.DataAction", {
extend: "my.action.Action",
requires: ["my.action.Action"],
alias: "action.dataaction",
notifyActionSuccess: function(component, msgTemplate, model) {
console.log("original action action");
}
});
答案 0 :(得分:2)
Ext.override(my.action.form.DataAction, {
notifyActionSuccess: function(component, msgTemplate, model) {
console.log("a new overridden action action");
}
});
或者您可以使用Ext.define:
Ext.define("my.action.form.DataActionOvrRide", {
override: "my.action.form.DataAction",
notifyActionSuccess: function(component, msgTemplate, model) {
console.log("new overridden action action");
}
});