2

如何在自定义 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");

   }
});
4

1 回答 1

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");

    }
});
于 2013-09-20T19:11:36.963 回答